about summary refs log tree commit diff stats
path: root/src/loader/response.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/loader/response.nim')
-rw-r--r--src/loader/response.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/loader/response.nim b/src/loader/response.nim
index e97e931b..a3b7e3e4 100644
--- a/src/loader/response.nim
+++ b/src/loader/response.nim
@@ -97,9 +97,8 @@ func getCharset*(this: Response; fallback: Charset): Charset =
 
 func getContentType*(this: Response; fallback = "application/octet-stream"):
     string =
-  if "Content-Type" in this.headers.table:
-    let header = this.headers.table["Content-Type"][0].toLowerAscii()
-    return header.until(';').strip()
+  this.headers.table.withValue("Content-Type", p):
+    return p[][0].untilLower(';').strip()
   # also use DefaultGuess for container, so that local mime.types cannot
   # override buffer mime.types
   return DefaultGuess.guessContentType(this.url.pathname, fallback)