send actual CGI status codes
authorpaul <paul@plutz.net>
Sat, 9 Dec 2017 20:18:40 +0000 (20:18 +0000)
committerpaul <paul@plutz.net>
Sat, 9 Dec 2017 20:18:40 +0000 (20:18 +0000)
svn path=/trunk/; revision=16

index.cgi

index 0397816..e28675c 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -92,7 +92,7 @@ QRYID="$(GET    id |checkid)"
 BDB="users/${COKID}"
 
 if [ -n "$QRYID" ]; then
-  printf '%s 303 See Other\r\n' "$SERVER_PROTOCOL"
+  printf 'Status: 303 See Other\r\n'
   printf 'Location: %s\r\n' "${SCRIPT_NAME}?${QUERY_STRING#id=????????????}"
   SET_COOKIE +8640000 "id=${QRYID}"
   printf '\r\n'
@@ -111,7 +111,7 @@ elif [ -z "$COKID" -a -z "$QRYID" ]; then
        EOF
   exit 0
 elif ! [ -d "${BDB}" ]; then
-  printf '%s 404 Not Found\r\n' "$SERVER_PROTOCOL"
+  printf 'Status: 404 Not Found\r\n'
   printf 'Content-Type: text/html; charset=utf-8\r\n\r\n'
 
   cat <<-EOF
@@ -132,7 +132,7 @@ case "$(GET action)" in
 
     { git init "users/${NEWID}" || mkdir -p "users/${NEWID}"; } >&-
 
-    printf '%s 303 See Other\r\n' "$SERVER_PROTOCOL"
+    printf 'Status: 303 See Other\r\n'
     printf 'Location: %s\r\n' "${SCRIPT_NAME}?id=${NEWID}"
     SET_COOKIE +8640000 "id=${NEWID}"
     printf '\r\n'