From b8053b284df3db3d6e16bb6aa03d3a8d0026ebbf Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Thu, 3 Jul 2014 16:57:45 +0200 Subject: [PATCH] Adds HEAD --- gin.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gin.go b/gin.go index dcb826f..d1d4262 100644 --- a/gin.go +++ b/gin.go @@ -264,6 +264,11 @@ func (group *RouterGroup) OPTIONS(path string, handlers ...HandlerFunc) { group.Handle("OPTIONS", path, handlers) } +// HEAD is a shortcut for router.Handle("HEAD", path, handle) +func (group *RouterGroup) HEAD(path string, handlers ...HandlerFunc) { + group.Handle("HEAD", path, handlers) +} + func (group *RouterGroup) combineHandlers(handlers []HandlerFunc) []HandlerFunc { s := len(group.Handlers) + len(handlers) h := make([]HandlerFunc, 0, s)