aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-04-11 11:02:59 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2022-04-11 11:35:13 +0200
commitce5bb34296429bd2401bb51c01522dd0c1bfbf83 (patch)
tree7adb6b23abbbeaab6bcae63acf555c1861afe670
parentsrc: shorter import (diff)
downloadlinux-status-ce5bb34296429bd2401bb51c01522dd0c1bfbf83.tar.gz
linux-status-ce5bb34296429bd2401bb51c01522dd0c1bfbf83.zip
app.py: print HTTP status when CGIing
-rwxr-xr-xsrc/app.py1
-rwxr-xr-xtest/test.sh2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/app.py b/src/app.py
index b0c4672..b83666e 100755
--- a/src/app.py
+++ b/src/app.py
@@ -90,6 +90,7 @@ class Response:
self.write_body_as_cgi_script()
def write_headers_as_cgi_script(self):
+ print(f'{self.status.value} {self.status.phrase}')
for name, val in self.headers():
print(f'{name}: {val}')
print()
diff --git a/test/test.sh b/test/test.sh
index 8597a24..3b22039 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -147,7 +147,7 @@ run_curl_tests() {
}
cgi_check_header() {
- local expected='Content-Type: text/html; charset=utf-8'
+ local expected='200 OK'
local actual
actual="$( head -n 1 -- "$curl_output_file" )"