mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-10 17:26:05 +01:00
Fix test CheckJSContent
This commit is contained in:
parent
9ac0e982d6
commit
db73b1f268
1 changed files with 3 additions and 1 deletions
|
@ -423,9 +423,11 @@ retry:
|
||||||
[Trait("Fast", "Fast")]
|
[Trait("Fast", "Fast")]
|
||||||
public async Task CheckJsContent()
|
public async Task CheckJsContent()
|
||||||
{
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate | DecompressionMethods.Brotli;
|
||||||
// This test verify that no malicious js is added in the minified files.
|
// This test verify that no malicious js is added in the minified files.
|
||||||
// We should extend the tests to other js files, but we can do as we go...
|
// We should extend the tests to other js files, but we can do as we go...
|
||||||
using var client = new HttpClient();
|
using var client = new HttpClient(handler);
|
||||||
var actual = GetFileContent("BTCPayServer", "wwwroot", "vendor", "bootstrap", "bootstrap.bundle.min.js").Trim();
|
var actual = GetFileContent("BTCPayServer", "wwwroot", "vendor", "bootstrap", "bootstrap.bundle.min.js").Trim();
|
||||||
var version = Regex.Match(actual, "Bootstrap v([0-9]+.[0-9]+.[0-9]+)").Groups[1].Value;
|
var version = Regex.Match(actual, "Bootstrap v([0-9]+.[0-9]+.[0-9]+)").Groups[1].Value;
|
||||||
var expected = (await (await client.GetAsync($"https://cdn.jsdelivr.net/npm/bootstrap@{version}/dist/js/bootstrap.bundle.min.js")).Content.ReadAsStringAsync()).Trim();
|
var expected = (await (await client.GetAsync($"https://cdn.jsdelivr.net/npm/bootstrap@{version}/dist/js/bootstrap.bundle.min.js")).Content.ReadAsStringAsync()).Trim();
|
||||||
|
|
Loading…
Add table
Reference in a new issue