From 4fd339e8c56080acfddb6d01e195553517dc1c1f Mon Sep 17 00:00:00 2001 From: Zviad Metreveli Date: Wed, 27 Jan 2016 19:02:42 -0500 Subject: [PATCH 1/2] fix fasthttpadaptor to work with http.ServeMux in Go 1.5 --- fasthttpadaptor/adaptor.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fasthttpadaptor/adaptor.go b/fasthttpadaptor/adaptor.go index 2070dfb..8a442bc 100644 --- a/fasthttpadaptor/adaptor.go +++ b/fasthttpadaptor/adaptor.go @@ -65,6 +65,9 @@ func NewFastHTTPHandler(h http.Handler) fasthttp.RequestHandler { }) r.Header = hdr r.Body = &netHTTPBody{body} + // After Go1.5 http.ServeMux uses URL field to get the path for + // request routing purposes. + r.URL = &url.URL{Path: string(ctx.Path())} var w netHTTPResponseWriter h.ServeHTTP(&w, &r) From 8b7405a861dd5713270218a796861038016fff7b Mon Sep 17 00:00:00 2001 From: Zviad Metreveli Date: Wed, 27 Jan 2016 19:07:56 -0500 Subject: [PATCH 2/2] add missing import --- fasthttpadaptor/adaptor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/fasthttpadaptor/adaptor.go b/fasthttpadaptor/adaptor.go index 8a442bc..6171cfd 100644 --- a/fasthttpadaptor/adaptor.go +++ b/fasthttpadaptor/adaptor.go @@ -5,6 +5,7 @@ package fasthttpadaptor import ( "io" "net/http" + "net/url" "github.com/valyala/fasthttp" )