blob: 7af5722e7b18b01b9ab6662cd9047242191aa6fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
function handleRequest(request, response) {
// Only answer to http, in case request is in https let the reply time out.
if (request.scheme === "https") {
response.processAsync();
return;
}
response.setHeader("Cache-Control", "no-cache", false);
// Send some file, e.g. an image
response.setHeader(
"Content-Disposition",
"attachment; filename=some-file.png"
);
response.setHeader("Content-Type", "image/png");
response.write("Success!");
}
|