mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
commit
ef271a088a
2 changed files with 3 additions and 5 deletions
|
@ -3614,15 +3614,13 @@ normal:
|
||||||
using (var tester = ServerTester.Create())
|
using (var tester = ServerTester.Create())
|
||||||
{
|
{
|
||||||
await tester.StartAsync();
|
await tester.StartAsync();
|
||||||
|
|
||||||
var url = tester.PayTester.ServerUri.AbsoluteUri;
|
var url = tester.PayTester.ServerUri.AbsoluteUri;
|
||||||
HttpClient client = new HttpClient();
|
|
||||||
|
|
||||||
// check onion location is present for HTML page request
|
// check onion location is present for HTML page request
|
||||||
using var htmlRequest = new HttpRequestMessage(HttpMethod.Get, new Uri(url));
|
using var htmlRequest = new HttpRequestMessage(HttpMethod.Get, new Uri(url));
|
||||||
htmlRequest.Headers.TryAddWithoutValidation("Accept", "text/html,*/*");
|
htmlRequest.Headers.TryAddWithoutValidation("Accept", "text/html,*/*");
|
||||||
|
|
||||||
var htmlResponse = await client.SendAsync(htmlRequest);
|
var htmlResponse = await tester.PayTester.HttpClient.SendAsync(htmlRequest);
|
||||||
htmlResponse.EnsureSuccessStatusCode();
|
htmlResponse.EnsureSuccessStatusCode();
|
||||||
Assert.True(htmlResponse.Headers.TryGetValues("Onion-Location", out var onionLocation));
|
Assert.True(htmlResponse.Headers.TryGetValues("Onion-Location", out var onionLocation));
|
||||||
Assert.StartsWith("http://wsaxew3qa5ljfuenfebmaf3m5ykgatct3p6zjrqwoouj3foererde3id.onion", onionLocation.FirstOrDefault() ?? "no-onion-location-header");
|
Assert.StartsWith("http://wsaxew3qa5ljfuenfebmaf3m5ykgatct3p6zjrqwoouj3foererde3id.onion", onionLocation.FirstOrDefault() ?? "no-onion-location-header");
|
||||||
|
@ -3631,7 +3629,7 @@ normal:
|
||||||
using var otherRequest = new HttpRequestMessage(HttpMethod.Get, new Uri(url));
|
using var otherRequest = new HttpRequestMessage(HttpMethod.Get, new Uri(url));
|
||||||
otherRequest.Headers.TryAddWithoutValidation("Accept", "*/*");
|
otherRequest.Headers.TryAddWithoutValidation("Accept", "*/*");
|
||||||
|
|
||||||
var otherResponse = await client.SendAsync(otherRequest);
|
var otherResponse = await tester.PayTester.HttpClient.SendAsync(otherRequest);
|
||||||
otherResponse.EnsureSuccessStatusCode();
|
otherResponse.EnsureSuccessStatusCode();
|
||||||
Assert.False(otherResponse.Headers.Contains("Onion-Location"));
|
Assert.False(otherResponse.Headers.Contains("Onion-Location"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>ReDoc</title>
|
<title>BTCPay Server Greenfield API</title>
|
||||||
<!-- needed for adaptive design -->
|
<!-- needed for adaptive design -->
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
Loading…
Add table
Reference in a new issue