diff options
author | bptato <nincsnevem662@gmail.com> | 2023-12-15 19:55:04 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-12-15 19:55:04 +0100 |
commit | b8cb40fd46e1d41925198ff171b9fbf8362bc924 (patch) | |
tree | 354cc95766f3ea72e7a66d1494488380249ddf2b /adapter | |
parent | fad4fb18c1665f6bc1d400f14eead706b63c4889 (diff) | |
download | chawan-b8cb40fd46e1d41925198ff171b9fbf8362bc924.tar.gz |
about: actually error out on error
Diffstat (limited to 'adapter')
-rw-r--r-- | adapter/protocol/about.nim | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/adapter/protocol/about.nim b/adapter/protocol/about.nim index 860294f3..02aacc00 100644 --- a/adapter/protocol/about.nim +++ b/adapter/protocol/about.nim @@ -3,12 +3,15 @@ import std/envvars const chawan = staticRead"res/chawan.html" const license = staticRead"res/license.html" -proc main() = +template printPage(s: static string) = stdout.write("Content-Type: text/html\n\n") + stdout.write(s) + +proc main() = case getEnv("MAPPED_URI_PATH") - of "blank": stdout.write("") - of "chawan": stdout.write(chawan) - of "license": stdout.write(license) - else: stdout.write("Error: about page not found") + of "blank": printPage("") + of "chawan": printPage(chawan) + of "license": printPage(license) + else: stdout.write("Cha-Control: ConnectionError 4 about page not found") main() |