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