1
0
Fork 0
firefox/toolkit/components/normandy/test/unit/cookie_server.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

12 lines
406 B
JavaScript

/**
* Sends responses that sets a cookie.
*/
function handleRequest(request, response) {
// Allow cross-origin, so you can XHR to it!
response.setHeader("Access-Control-Allow-Origin", "*", false);
// Avoid confusing cache behaviors
response.setHeader("Cache-Control", "no-cache", false);
// Set a cookie
response.setHeader("Set-Cookie", "type=chocolate-chip", false);
response.write("");
}