fix: file caching directive

This commit is contained in:
Ramires Viana
2021-08-06 12:31:39 +00:00
committed by Oleg Lobanov
parent 25c8788390
commit c63cc5a2d2
3 changed files with 11 additions and 31 deletions

View File

@@ -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
}