|
1 /* |
|
2 * Any copyright is dedicated to the Public Domain. |
|
3 * http://creativecommons.org/publicdomain/zero/1.0/ |
|
4 */ |
|
5 |
|
6 function handleRequest(request, response) |
|
7 { |
|
8 var Etag = '"4c881ab-b03-435f0a0f9ef00"'; |
|
9 var IfNoneMatch = request.hasHeader("If-None-Match") |
|
10 ? request.getHeader("If-None-Match") |
|
11 : ""; |
|
12 |
|
13 var page = "<!DOCTYPE html><html><body><p>hello world!</p></body></html>"; |
|
14 |
|
15 response.setHeader("Etag", Etag, false); |
|
16 |
|
17 if (IfNoneMatch == Etag) { |
|
18 response.setStatusLine(request.httpVersion, "304", "Not Modified"); |
|
19 } |
|
20 else { |
|
21 response.setHeader("Content-Type", "text/html", false); |
|
22 response.setHeader("Content-Length", page.length + "", false); |
|
23 response.write(page); |
|
24 } |
|
25 } |