mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-20 01:56:37 +03:00
Add regression tests for token-authorized CORS on non-localhost dev hosts
Covers the fix for the ddev breakage reported in #304: the live server now reflects Access-Control-Allow-Origin for any request bearing the valid session token, so dev servers on loopback aliases (https://*.ddev.site, Valet's *.test, hosts-file entries) work again while tokenless remote origins stay blocked. The server/browser source changes shipped in b1c5707f; this adds the test coverage that was written alongside them: - tokenless remote origins get no ACAO on any route, token'd or not - a non-loopback origin with the valid token is reflected, with Vary: Origin, on both the real request and its OPTIONS preflight - the /manual-edit-stash source assertion tracks the token-bearing URL Prepared with AI assistance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
f2f73edb33
commit
0f80c1f5aa
@@ -42,7 +42,7 @@ describe('live-browser source contracts', () => {
|
||||
);
|
||||
assert.match(
|
||||
SOURCE,
|
||||
/fetch\('http:\/\/localhost:' \+ PORT \+ '\/manual-edit-stash'[\s\S]{0,260}?pageUrl: location\.pathname[\s\S]{0,80}?element: extractContext\(contextElement\)[\s\S]{0,40}?ops,/,
|
||||
/fetch\('http:\/\/localhost:' \+ PORT \+ '\/manual-edit-stash\?token='[\s\S]{0,300}?pageUrl: location\.pathname[\s\S]{0,80}?element: extractContext\(contextElement\)[\s\S]{0,40}?ops,/,
|
||||
'Save should stage edits through /manual-edit-stash with element context and ops',
|
||||
);
|
||||
assert.match(
|
||||
|
||||
Reference in New Issue
Block a user