aboutsummaryrefslogtreecommitdiff
path: root/fasthttpadaptor
diff options
context:
space:
mode:
authorGravatar Zviad Metreveli <zviad@dropbox.com> 2016-01-27 19:02:42 -0500
committerGravatar Zviad Metreveli <zviad@dropbox.com> 2016-01-27 19:02:42 -0500
commit4fd339e8c56080acfddb6d01e195553517dc1c1f (patch)
tree3cb9a788ff527ba34b89c3e47210bb558e93cb45 /fasthttpadaptor
parentServer: make sure that net.Listener returns nil conn on non-nil error (diff)
downloadfasthttp-4fd339e8c56080acfddb6d01e195553517dc1c1f.tar.gz
fasthttp-4fd339e8c56080acfddb6d01e195553517dc1c1f.tar.bz2
fasthttp-4fd339e8c56080acfddb6d01e195553517dc1c1f.zip
fix fasthttpadaptor to work with http.ServeMux in Go 1.5
Diffstat (limited to 'fasthttpadaptor')
-rw-r--r--fasthttpadaptor/adaptor.go3
1 files changed, 3 insertions, 0 deletions
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)