Skip to content

Commit 1737a76

Browse files
faridtsllunny
andauthored
Adding Chi's GetHead middleware (#14541)
Before moving to Chi, HEAD requests were automatically answered by GET handlers (SetAutoHead(true) from macaron was used). This Change will restore the previous behaviour. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 3f332a9 commit 1737a76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

routers/routes/web.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ func WebRoutes() *web.Route {
162162
}
163163
// Removed: toolbox.Toolboxer middleware will provide debug informations which seems unnecessary
164164
r.Use(context.Contexter())
165-
// Removed: SetAutoHead allow a get request redirect to head if get method is not exist
165+
// GetHead allows a HEAD request redirect to GET if HEAD method is not defined for that route
166+
r.Use(middleware.GetHead)
166167

167168
if setting.EnableAccessLog {
168169
r.Use(context.AccessLogger())

0 commit comments

Comments
 (0)