summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/macaron.v1/router.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gopkg.in/macaron.v1/router.go')
-rw-r--r--vendor/gopkg.in/macaron.v1/router.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/gopkg.in/macaron.v1/router.go b/vendor/gopkg.in/macaron.v1/router.go
index 950c5bcb09..df593d669a 100644
--- a/vendor/gopkg.in/macaron.v1/router.go
+++ b/vendor/gopkg.in/macaron.v1/router.go
@@ -96,7 +96,7 @@ func NewRouter() *Router {
}
// SetAutoHead sets the value who determines whether add HEAD method automatically
-// when GET method is added. Combo router will not be affected by this value.
+// when GET method is added.
func (r *Router) SetAutoHead(v bool) {
r.autoHead = v
}
@@ -341,6 +341,9 @@ func (cr *ComboRouter) route(fn func(string, ...Handler) *Route, method string,
}
func (cr *ComboRouter) Get(h ...Handler) *ComboRouter {
+ if cr.router.autoHead {
+ cr.Head(h...)
+ }
return cr.route(cr.router.Get, "GET", h...)
}