HH-531: remove CSP-blocked draggable shim (#122)
Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -27,3 +27,13 @@ assert.ok(
|
||||
);
|
||||
assert.ok(!/<script(?![^>]*\bsrc=)[^>]*>/i.test(html), 'inline script found');
|
||||
assets.forEach(asset => assert.ok(existsSync(dist + asset.slice(1)), asset));
|
||||
|
||||
const dashboard = assets
|
||||
.filter(asset => asset.endsWith('.js'))
|
||||
.map(asset => readFileSync(dist + asset.slice(1), 'utf8'))
|
||||
.join('\n');
|
||||
assert.doesNotMatch(
|
||||
dashboard,
|
||||
/=\(?function\(\)\{return this\}\)?\(\);try\{([A-Za-z_$][\w$]*)=\1\|\|new Function\("return this"\)\(\)/,
|
||||
'dashboard contains a CSP-blocked UMD global shim'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user