fix: file caching directive
This commit is contained in:
committed by
Oleg Lobanov
parent
25c8788390
commit
c63cc5a2d2
@@ -3,7 +3,6 @@ package http
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
@@ -67,11 +66,3 @@ func stripPrefix(prefix string, h http.Handler) http.Handler {
|
||||
h.ServeHTTP(w, r2)
|
||||
})
|
||||
}
|
||||
|
||||
func checkEtag(w http.ResponseWriter, r *http.Request, fTime, fSize int64) bool {
|
||||
etag := fmt.Sprintf("%x%x", fTime, fSize)
|
||||
w.Header().Set("Cache-Control", "private")
|
||||
w.Header().Set("Etag", etag)
|
||||
|
||||
return r.Header.Get("If-None-Match") == etag
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user