From 3b35380c8ef69b30a74017b1ee5dc142283800dc Mon Sep 17 00:00:00 2001 From: muja Date: Mon, 6 Apr 2015 01:04:10 +0200 Subject: [PATCH] When adding a GET request handler, add one for HEAD as well. --- router.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/router.go b/router.go index d2b3945..b83f275 100644 --- a/router.go +++ b/router.go @@ -165,9 +165,10 @@ func (r *Router) Group(pattern string, fn func(), h ...Handler) { r.groups = r.groups[:len(r.groups)-1] } -// Get is a shortcut for r.Handle("GET", pattern, handlers) +// Get is a shortcut for r.Handle("GET", pattern, handlers) and r.Handle("HEAD", pattern, handlers) func (r *Router) Get(pattern string, h ...Handler) { r.Handle("GET", pattern, h) + r.Handle("HEAD", pattern, h) } // Patch is a shortcut for r.Handle("PATCH", pattern, handlers)