Adds HEAD method in Static file serving

This commit is contained in:
Manu Mtz-Almeida 2014-07-17 02:07:18 +02:00
parent dda70bf382
commit 15c27c712d

3
gin.go
View File

@ -210,6 +210,9 @@ func (group *RouterGroup) Static(p, root string) {
group.GET(p, func(c *Context) { group.GET(p, func(c *Context) {
fileServer.ServeHTTP(c.Writer, c.Request) fileServer.ServeHTTP(c.Writer, c.Request)
}) })
group.HEAD(p, func(c *Context) {
fileServer.ServeHTTP(c.Writer, c.Request)
})
} }
func (group *RouterGroup) combineHandlers(handlers []HandlerFunc) []HandlerFunc { func (group *RouterGroup) combineHandlers(handlers []HandlerFunc) []HandlerFunc {