Pārlūkot izejas kodu

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

Jakob Borg 2 gadi atpakaļ
vecāks
revīzija
cbec697e5f
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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
 	}