File: 0001-Avoid-julienschmidt-httprouter-version-mismatch.patch

package info (click to toggle)
golang-github-manyminds-api2go 1.0-RC2%2Bgit20161229.31.dc368bb-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 484 kB
  • ctags: 488
  • sloc: sh: 23; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 1,081 bytes parent folder | download
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}
 }