about summary refs log tree commit diff stats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-01-22 18:34:23 +0100
committerbptato <nincsnevem662@gmail.com>2022-01-22 18:34:23 +0100
commit7b06c22d8f24de727ce5b62b4d7fd8cd4007123d (patch)
treec92bd6243e249516ea51a0221c0e1b6c97adee48 /src/types
parent4b5a3cbbf3ef3c75915f92d9ce487c0c9ff2884a (diff)
downloadchawan-7b06c22d8f24de727ce5b62b4d7fd8cd4007123d.tar.gz
Fix page navigation
Diffstat (limited to 'src/types')
-rw-r--r--src/types/mime.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/types/mime.nim b/src/types/mime.nim
index 4dfe87e9..5c48c896 100644
--- a/src/types/mime.nim
+++ b/src/types/mime.nim
@@ -6,6 +6,8 @@ const DefaultGuess = [
   ("xhtml", "application/xhtml+xml"),
   ("xhtm", "application/xhtml+xml"),
   ("xht", "application/xhtml+xml"),
+  ("txt", "text/plain"),
+  ("", "text/plain")
 ].toTable()
 
 proc guessContentType*(path: string): string =
@@ -13,7 +15,7 @@ proc guessContentType*(path: string): string =
   var n = 0
   while i > 0:
     if path[i] == '/':
-      return "text/plain"
+      return DefaultGuess[""]
     if path[i] == '.':
       n = i
       break
@@ -22,4 +24,4 @@ proc guessContentType*(path: string): string =
     let ext = path.substr(n + 1)
     if ext in DefaultGuess:
       return DefaultGuess[ext]
-  return "text/plain"
+  return DefaultGuess[""]