aboutsummaryrefslogtreecommitdiffstats
path: root/adapter/protocol
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-12-15 19:55:04 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-15 19:55:04 +0100
commitb8cb40fd46e1d41925198ff171b9fbf8362bc924 (patch)
tree354cc95766f3ea72e7a66d1494488380249ddf2b /adapter/protocol
parentfad4fb18c1665f6bc1d400f14eead706b63c4889 (diff)
downloadchawan-b8cb40fd46e1d41925198ff171b9fbf8362bc924.tar.gz
about: actually error out on error
Diffstat (limited to 'adapter/protocol')
-rw-r--r--adapter/protocol/about.nim13
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()