Skip to content
Snippets Groups Projects
Commit 3107ab0a authored by Zed's avatar Zed
Browse files

Fix content-length crash

parent 2d7e12fc
No related branches found
No related tags found
No related merge requests found
......@@ -44,9 +44,15 @@ proc proxyMedia*(req: jester.Request; url: string): Future[HttpCode] {.async.} =
if request.headers.getOrDefault("If-None-Match") == hashed:
return Http304
let contentLength =
if res.headers.hasKey("content-length"):
res.headers["content-length", 0]
else:
""
let headers = newHttpHeaders({
"Content-Type": res.headers["content-type", 0],
"Content-Length": res.headers["content-length", 0],
"Content-Length": contentLength,
"Cache-Control": maxAge,
"ETag": hashed
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment