diff options
author | tv <tv@vix> | 2010-02-07 01:59:29 +0100 |
---|---|---|
committer | tv <tv@vix> | 2010-02-07 01:59:29 +0100 |
commit | 021b3208adb10cd25763450129c762042ed251a7 (patch) | |
tree | 7c63b8c3a9b172aa0ce7f6a66ca4dc43054e5d8f /htgen.sh | |
parent | 3b6fa7d72a3b7987c06348c985da9123a45c10ff (diff) |
Added handler for /dump.txt
Diffstat (limited to 'htgen.sh')
-rwxr-xr-x | htgen.sh | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -54,9 +54,23 @@ case "$Host" in case "${Method-Invalid-Request}" in GET|HEAD) case "$Request_URI" in + /dump.txt) + body_type=file + body=~/public_html$Request_URI + status=200 + cat<<EOF +HTTP/1.0 200 OK
+Connection: close
+Content-Length: `du -b $body | cut -f1`
+Content-Type: text/plain; charset=utf-8
+Server: $Server
+
+EOF + ;; /style5.css) body_type=file body=~/public_html$Request_URI + status=200 cat<<EOF HTTP/1.0 200 OK
Connection: close
@@ -69,6 +83,7 @@ EOF /favicon5.png|/favicon2.png) body_type=file body=~/public_html$Request_URI + status=200 cat<<EOF HTTP/1.0 200 OK
Connection: close
@@ -80,13 +95,15 @@ Cache-Control: public EOF ;; /|/index.html) - # XXX this is a hack: make -C ~/public_html index.html >&2 + #### XXX this is a hack: + ### make -C ~/public_html index.html >&2 # TODO 304 Not Modified # TODO better max-age(?) # TODO may we use more than one Cache-Control? body_type=file body=~/public_html/index.html + status=200 cat<<EOF HTTP/1.0 200 OK
Content-Type: text/html; charset=UTF-8
@@ -100,6 +117,7 @@ EOF *) body_type=string body="404 Not found: $Request_URI" + status=404 cat<<EOF HTTP/1.0 404 Not Found
Content-Type: text/plain; charset=UTF-8
@@ -114,6 +132,7 @@ EOF *) # Method body_type=string body="501 Not Implemented: $Method" + status=501 cat<<EOF HTTP/1.0 501 Not Implemented
Content-Type: text/plain; charset=UTF-8
@@ -129,6 +148,7 @@ EOF *) # Host body_type=string body="403 Forbidden" + status=403 cat<<EOF HTTP/1.1 403 Forbidden
Content-Type: text/plain; charset=UTF-8
@@ -154,5 +174,5 @@ esac # Success (mod transfer) -echo "# OK" >&2 +echo "# OK: $status" >&2 exit |