From cbec697e5fc054fe7d575ec171276f4b030f8cee Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 22 Feb 2023 12:22:52 +0100 Subject: [PATCH] cmd/stupgrades: Cache should apply to HEAD as well as GET --- lib/httpcache/httpcache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/httpcache/httpcache.go b/lib/httpcache/httpcache.go index f3339192b..e8e442dc1 100644 --- a/lib/httpcache/httpcache.go +++ b/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 }