mirror of
https://github.com/nkanaev/yarr.git
synced 2025-09-13 09:55:36 +00:00
status 304 (not modified)
This commit is contained in:
@@ -108,6 +108,10 @@ func StaticHandler(rw http.ResponseWriter, req *http.Request) {
|
|||||||
|
|
||||||
if assets != nil {
|
if assets != nil {
|
||||||
if asset, ok := assets[path]; ok {
|
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-Type", ctype)
|
||||||
rw.Header().Set("Content-Encoding", "gzip")
|
rw.Header().Set("Content-Encoding", "gzip")
|
||||||
rw.Header().Set("Etag", asset.etag)
|
rw.Header().Set("Etag", asset.etag)
|
||||||
|
Reference in New Issue
Block a user