mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
status 304 (not modified)
This commit is contained in:
parent
4f6e9e5c7c
commit
06458065d6
@ -108,6 +108,10 @@ func StaticHandler(rw http.ResponseWriter, req *http.Request) {
|
||||
|
||||
if assets != nil {
|
||||
if asset, ok := assets[path]; ok {
|
||||
if req.Header.Get("if-none-match") == asset.etag {
|
||||
rw.WriteHeader(http.StatusNotModified)
|
||||
return
|
||||
}
|
||||
rw.Header().Set("Content-Type", ctype)
|
||||
rw.Header().Set("Content-Encoding", "gzip")
|
||||
rw.Header().Set("Etag", asset.etag)
|
||||
|
Loading…
x
Reference in New Issue
Block a user