1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 function handleRequest(request, response) {
8 response.setStatusLine(request.httpVersion, 200, "OK");
9 response.setHeader("Cache-Control", "no-cache", false);
10 response.setHeader("Content-Type", "text/html", false);
12 // configure set-cookie domain
14 if (request.hasHeader("return-cookie-domain")) {
15 domain = "; Domain=" + request.getHeader("return-cookie-domain");
18 // configure set-cookie sameSite
19 let authStr = "; Secure";
20 if (request.hasHeader("return-insecure-cookie")) {
24 // use headers to decide if we have them
25 if (request.hasHeader("return-set-cookie")) {
28 request.getHeader("return-set-cookie") + authStr + domain,
33 let body = "<!DOCTYPE html> <html> <body> true </body> </html>";