Skip to content

Commit

Permalink
test: update test to check empty Accept-Encoding header
Browse files Browse the repository at this point in the history
  • Loading branch information
daniluk4000 committed Nov 2, 2024
1 parent 9aee1ea commit 0f9f018
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ export function testNitro(
let headers = (await callHandler({ url: "/foo.css", headers: { "Accept-Encoding": "gzip" } })).headers;
if (headers["vary"]) expect(headers["vary"]).toBe("Origin, Accept-Encoding");

headers = (await callHandler({ url: "/foo.css", headers: { "Accept-Encoding": "" } })).headers;
if (headers["vary"]) expect(headers["vary"]).toBe("Origin");

headers = (await callHandler({ url: "/foo.js", headers: { "Accept-Encoding": "gzip" } })).headers;

//For some reason, sometimes there are no space between Origin and Accept-Encoding when passing headers as an array
Expand Down

0 comments on commit 0f9f018

Please sign in to comment.