Browse Source

cmd/stupgrades: Cache should apply to HEAD as well as GET

Jakob Borg 2 years ago
parent
commit
cbec697e5f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/httpcache/httpcache.go

+ 1 - 1
lib/httpcache/httpcache.go

@@ -79,7 +79,7 @@ func (r *responseRecorder) Header() http.Header {
 }
 
 func (s *SinglePathCache) ServeHTTP(w http.ResponseWriter, r *http.Request) {
-	if r.Method != http.MethodGet {
+	if r.Method != http.MethodGet && r.Method != http.MethodHead {
 		s.next.ServeHTTP(w, r)
 		return
 	}