diff options
Diffstat (limited to 'src/loader/response.nim')
-rw-r--r-- | src/loader/response.nim | 5 |
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) |