gecko-dev/dom/serviceworkers/test/header_checker.sjs

10 строки
309 B
JavaScript

function handleRequest(request, response) {
if (request.getHeader("Service-Worker") === "script") {
response.setStatusLine("1.1", 200, "OK");
response.setHeader("Content-Type", "text/javascript");
response.write("// empty");
} else {
response.setStatusLine("1.1", 404, "Not Found");
}
}