From 78c7cd0c010c1c90dbc3358c2710bddaed379ce9 Mon Sep 17 00:00:00 2001 From: Alex Musolino Date: Wed, 5 Jun 2019 16:04:50 +0930 Subject: 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. --- rc/bin/rc-httpd/handlers/dir-index | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3