1
0
Fork 0
firefox/netwerk/cookie/test/browser/oversize.sjs
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

27 lines
649 B
JavaScript

function handleRequest(aRequest, aResponse) {
aResponse.setStatusLine(aRequest.httpVersion, 200);
const maxBytesPerCookie = 4096;
const maxBytesPerAttribute = 1024;
aResponse.setHeader(
"Set-Cookie",
"a=" + Array(maxBytesPerCookie + 1).join("x"),
true
);
aResponse.setHeader(
"Set-Cookie",
"b=c; path=/" + Array(maxBytesPerAttribute + 1).join("x"),
true
);
aResponse.setHeader(
"Set-Cookie",
"c=42; domain=" + Array(maxBytesPerAttribute + 1).join("x") + ".net",
true
);
aResponse.setHeader(
"Set-Cookie",
"d=42; max-age=" + Array(maxBytesPerAttribute + 2).join("x"),
true
);
}