1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
From: "Diego M. Rodriguez" <diego.plan9@gmail.com>
Date: Wed, 29 Mar 2017 11:31:07 +0200
Subject: Avoid julienschmidt-httprouter version mismatch
Fix an issue related to julienschmidt-httprouter versions: the latest
release is 1.1 (same as in Debian), but master/HEAD on upstream
contains changes that break compatibility slightly in preparation for
1.2.
More information (and the inspiration for this fix) can be found at:
https://github.com/manyminds/api2go/pull/178
---
routing/httprouter.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/routing/httprouter.go b/routing/httprouter.go
index 2f6a6fd..2394bc5 100644
--- a/routing/httprouter.go
+++ b/routing/httprouter.go
@@ -48,6 +48,6 @@ func (h HTTPRouter) GetRouteParameter(r http.Request, param string) string {
func NewHTTPRouter(prefix string, notAllowedHandler http.Handler) Routeable {
router := httprouter.New()
router.HandleMethodNotAllowed = true
- router.MethodNotAllowed = notAllowedHandler
+ router.MethodNotAllowed = notAllowedHandler.ServeHTTP
return &HTTPRouter{router: router}
}
|