shithub: werc

Download patch

ref: 0dc9b7b311f568e6bf8798588ffe16dfbb303d19
parent: 9a3a9c26111ff179b2cfea3a8ec464b01ede7182
author: uriel <[email protected]>
date: Sun Aug 9 14:39:54 EDT 2009

For HEAD request, only quit after we send the new line that ends the headers section. This was making nginx unhappy. Thanks arg for reporting, tracking it down and fixing this bug!

--- a/bin/werc.rc
+++ b/bin/werc.rc
@@ -123,13 +123,13 @@
     for(h in $extraHttpHeaders)
         echo $h
     echo 'Content-Type: '^$http_content_type
-    if(~ $REQUEST_METHOD HEAD)
-        exit
     echo # End of HTTP headers
 
     if(! ~ $#debug 0)
         dprint $"SERVER_NAME^$"REQUEST_URI - $"HTTP_USER_AGENT - $"REQUEST_METHOD - $"handler_body_main - $"master_template
 
+    if(~ $REQUEST_METHOD HEAD)
+        exit
     
     template $headers $master_template | awk_buffer
     echo $res_tail