diff --git a/handlers.go b/handlers.go index 5a58e50..f655a29 100644 --- a/handlers.go +++ b/handlers.go @@ -316,6 +316,8 @@ func contentHandler(db *gorm.DB, cfg Config) http.HandlerFunc { } w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%d, must-revalidate", ttl)) + w.Header().Set("ETag", "\""+hex.EncodeToString(upload.SHA256)+"\"") + w.Header().Set("Content-Security-Policy", "sandbox") w.Header().Set("Content-Type", upload.MIMEType) w.Header().Set("X-Content-Type-Options", "nosniff") http.ServeContent(w, r, upload.Filename, time.Unix(upload.CreatedAt, 0), file)