summaryrefslogtreecommitdiff
path: root/rc/bin/rc-httpd
diff options
context:
space:
mode:
authorAlex Musolino <alex@musolino.id.au>2019-06-05 16:04:50 +0930
committerAlex Musolino <alex@musolino.id.au>2019-06-05 16:04:50 +0930
commit78c7cd0c010c1c90dbc3358c2710bddaed379ce9 (patch)
treedbac107ab058254982ffa9fda06c733752faddfa /rc/bin/rc-httpd
parent341b64b5bd0af48ec4bb7b11a54c953c52b22d03 (diff)
downloadplan9front-78c7cd0c010c1c90dbc3358c2710bddaed379ce9.tar.xz
rc-httpd(8): avoid duplicate log output in dir-index handler
Delay calling do_log until just before emitting the response. This avoids calling do_log before potentially handing control to the static-index handler, which also calls do_log.
Diffstat (limited to 'rc/bin/rc-httpd')
-rwxr-xr-xrc/bin/rc-httpd/handlers/dir-index2
1 files changed, 1 insertions, 1 deletions
diff --git a/rc/bin/rc-httpd/handlers/dir-index b/rc/bin/rc-httpd/handlers/dir-index
index 31e5b0236..8abf6f8fa 100755
--- a/rc/bin/rc-httpd/handlers/dir-index
+++ b/rc/bin/rc-httpd/handlers/dir-index
@@ -10,7 +10,6 @@ if(! test -r $full_path -x $full_path){
error 503
exit
}
-do_log 200
builtin cd $full_path
if(~ $"NOINDEXFILE ^ $"NOINDEX ''){
ifile=index.htm*
@@ -30,6 +29,7 @@ case size
case date
lso=-t
}
+do_log 200
echo 'HTTP/1.1 200 OK'^$cr
emit_extra_headers
echo 'Content-type: text/html'^$cr