mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 08:42:13 +00:00
288cbe9f46
Differential Revision: https://phabricator.services.mozilla.com/D151381
26 lines
664 B
JavaScript
26 lines
664 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
"use strict";
|
|
|
|
const WORKER = `
|
|
onmessage = function(event) {
|
|
fetch(event.data, {
|
|
mode: "no-cors",
|
|
credentials: "include"
|
|
}).then(function() {
|
|
postMessage("fetch done");
|
|
});
|
|
}
|
|
`;
|
|
|
|
function handleRequest(request, response) {
|
|
if (request.queryString === "credentialless") {
|
|
response.setHeader("Cross-Origin-Embedder-Policy", "credentialless", true);
|
|
}
|
|
|
|
response.setHeader("Content-Type", "application/javascript", false);
|
|
response.setStatusLine(request.httpVersion, "200", "Found");
|
|
response.write(WORKER);
|
|
}
|