forked from unimatrix/web
Fix Company CP artwork loading and responsive image bounds
This commit is contained in:
parent
ab4e493c24
commit
5cd01a8d7b
1 changed files with 13 additions and 5 deletions
|
|
@ -6,6 +6,9 @@ test('Company CP clones the Clan frame, has isolated company navigation and perm
|
|||
const response=await app(new Request('https://cp.dunerealms.com/company-cp'));assert.equal(response.status,200);const html=await response.text();
|
||||
assert.match(html,/data-cp-mode="company"/);assert.match(html,/cp-v2-company-shell.mjs/);assert.match(html,/id="sidebar-right"/);assert.doesNotMatch(html,/src="\/v2\/v2.js|cp-v2-clan-size.mjs|class="dune-site-header"/);
|
||||
assert.match(response.headers.get('content-security-policy'),/frame-ancestors[^;]*https:\/\/corp.dunerealms.com/);
|
||||
const policy=response.headers.get('content-security-policy');
|
||||
assert.match(policy,/img-src 'self' data: https:\/\/www.dunerealms.com(?:;|$)/,'Company portraits and CSS backgrounds must load from the canonical artwork host');
|
||||
assert.doesNotMatch(policy,/img-src[^;]*(?:https:;|\*)/,'Artwork permission must remain limited to the canonical host');
|
||||
assert.equal((await app(new Request('https://cp.dunerealms.com/company-cp',{method:'POST'}))).status,405);
|
||||
assert.equal((await app(new Request('https://cp.dunerealms.com/api/companies/workspace'))).status,401);
|
||||
for(const path of ['cp-v2-company-shell.mjs','cp-v2-company-shell.css','cp-v2-policy-catalogue.mjs','cp-v2-claims.mjs'])assert.equal((await app(new Request('https://cp.dunerealms.com/v2/'+path))).status,200);
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff