From: Eric Wong <e@80x24.org>
Date: Thu, 17 Apr 2014 21:30:21 +0000 (+0000)
Subject: cgi: include HTTP status in error message body
X-Git-Tag: v1.0.0~1243
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b2da3f40fb7650a658b6ed1a15c81704d91b2831;p=public-inbox.git

cgi: include HTTP status in error message body

This makes it slightly easier for out-of-the-box curl users since
curl does not report or show the error by default.
---

diff --git a/public-inbox.cgi b/public-inbox.cgi
index 9d60d1fc..bd592ce3 100755
--- a/public-inbox.cgi
+++ b/public-inbox.cgi
@@ -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 {