Assert Vary: Origin on the authorized CORS preflight too

Review follow-up: the reflected-origin contract matters most on the
OPTIONS preflight, where a cached response authorized for one origin
must never be served to another.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-07-31 18:06:55 -07:00
co-authored by Claude Fable 5
parent 0f80c1f5aa
commit 675656c18c
+4
View File
@@ -431,6 +431,10 @@ describe('live-server integration', () => {
});
assert.equal(preflight.status, 204);
assert.equal(preflight.headers.get('access-control-allow-origin'), origin);
assert.ok(
/\bOrigin\b/i.test(preflight.headers.get('vary') || ''),
'Vary: Origin accompanies the reflected origin on the preflight too',
);
});
it('CORS: a loopback origin is reflected with Vary: Origin', async () => {