From 617463f109a45664689fc47cbbcab35495888894 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Sat, 10 Sep 2022 14:11:42 -0600 Subject: [PATCH] Improved http response --- back/lib/http_res | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/back/lib/http_res b/back/lib/http_res index c56ea9a..5832387 100755 --- a/back/lib/http_res +++ b/back/lib/http_res @@ -6,11 +6,11 @@ # Parse status status='' case "${1}" in - ''|'0'|'200') status='200 OK\n';; - '201') status='201 Created\n';; - '202') status='202 Accepted\n';; - '400') status='400 Bad Request\n';; - '500') status='500 Internal Server Error\n';; + ''|'0'|'200') status='HTTP/1.0 200 OK\n';; + '201') status='HTTP/1.0 201 Created\n';; + '202') status='HTTP/1.0 202 Accepted\n';; + '400') status='HTTP/1.0 400 Bad Request\n';; + '500') status='HTTP/1.0 500 Internal Server Error\n';; *) exit 3;; esac @@ -25,4 +25,4 @@ elif [ "${2}" == '' ] fi # Send response -printf "${status}${content_type}\n${body}\n" \ No newline at end of file +printf "${status}${content_type}\nDate:$(date)\n${body}\n" \ No newline at end of file