浏览代码

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
 	}