mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Merge pull request #222 from samueleaton/master
Remove Content-Type response header if the file is cached
This commit is contained in:
commit
450dab9f81
1 changed files with 1 additions and 0 deletions
|
@ -80,6 +80,7 @@ module Kemal
|
|||
etag = %{W/"#{File.lstat(file_path).mtime.epoch.to_s}"}
|
||||
context.response.headers["ETag"] = etag
|
||||
return false if !context.request.headers["If-None-Match"]? || context.request.headers["If-None-Match"] != etag
|
||||
context.response.headers.delete "Content-Type"
|
||||
context.response.content_length = 0
|
||||
context.response.status_code = 304 # not modified
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue