소스 검색

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

Jakob Borg 2 년 전
부모
커밋
cbec697e5f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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
 	}