1
0
Fork 0
firefox/dom/security/test/mixedcontentblocker/download_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

20 lines
573 B
JavaScript

// force the Browser to Show a Download Prompt
function handleRequest(request, response) {
let type = "image/png";
let filename = "hello.png";
request.queryString.split("&").forEach(val => {
var [key, value] = val.split("=");
if (key == "type") {
type = value;
}
if (key == "name") {
filename = value;
}
});
response.setHeader("Cache-Control", "no-cache", false);
response.setHeader("Content-Disposition", `attachment; filename=${filename}`);
response.setHeader("Content-Type", type);
response.write("🙈🙊🐵🙊");
}