]> Sergey Matveev's repositories - public-inbox.git/commitdiff
cgi: include HTTP status in error message body
authorEric Wong <e@80x24.org>
Thu, 17 Apr 2014 21:30:21 +0000 (21:30 +0000)
committerEric Wong <e@80x24.org>
Thu, 17 Apr 2014 21:30:21 +0000 (21:30 +0000)
This makes it slightly easier for out-of-the-box curl users since
curl does not report or show the error by default.

public-inbox.cgi

index 9d60d1fc6370f6a9be163279de86110f51ad4bc3..bd592ce3e3107c6ed77ea51f0cf0c761284393e4 100755 (executable)
@@ -95,7 +95,7 @@ sub main {
 sub r404 { r("404 Not Found") }
 
 # simple response for errors
-sub r { [ $_[0], { 'Content-Type' => 'text/plain' }, '' ] }
+sub r { [ $_[0], { 'Content-Type' => 'text/plain' }, $_[0]."\n" ] }
 
 # returns undef if valid, array ref response if invalid
 sub invalid_list {