Fix Company CP artwork loading and responsive image bounds

This commit is contained in:
unimatrixgit 2026-11-16 07:21:52 +01:00
commit 5cd01a8d7b

View file

@ -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);