Merge pull request #1409 from Kukks/fix-link-test

Fix Link checker test
This commit is contained in:
Nicolas Dorier 2020-03-25 19:33:50 +09:00 committed by GitHub
commit e596513fc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -122,12 +122,15 @@ namespace BTCPayServer.Tests
var url = match.Groups[1].Value;
try
{
Assert.Equal(HttpStatusCode.OK, (await httpClient.GetAsync(url)).StatusCode);
using var request = new HttpRequestMessage(HttpMethod.Get, new Uri(url));
request.Headers.TryAddWithoutValidation("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
request.Headers.TryAddWithoutValidation("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0");
Assert.Equal(HttpStatusCode.OK, (await httpClient.SendAsync(request)).StatusCode);
Logs.Tester.LogInformation($"OK: {url} ({file})");
}
catch
catch(EqualException ex)
{
Logs.Tester.LogInformation($"FAILED: {url} ({file})");
Logs.Tester.LogInformation($"FAILED: {url} ({file}) {ex.Actual}");
throw;
}
}

View File

@ -9,7 +9,6 @@
<li>
<p>
Download a two-factor authenticator app like Microsoft Authenticator for
<a href="https://go.microsoft.com/fwlink/?Linkid=825071">Windows Phone</a>,
<a href="https://go.microsoft.com/fwlink/?Linkid=825072">Android</a> and
<a href="https://go.microsoft.com/fwlink/?Linkid=825073">iOS</a> or
Google Authenticator for