Populate Request.URL.Path correctly.
Before, the Request.URL.Path was blank, causing the DefaultServeMux to
redirect in a loop forever.
This is the first version I've verified to work with both Firefox
Nightly and Chrome, both with their respective HTTP/2 modes enabled.
diff --git a/server.go b/server.go
index 15ef9d9..8ae0bab 100644
--- a/server.go
+++ b/server.go
@@ -718,9 +718,14 @@
sc: sc,
streamID: rp.stream.id,
}
+ url, err := url.ParseRequestURI(rp.path)
+ if err != nil {
+ // TODO: find the right error code?
+ return nil, nil, StreamError{rp.stream.id, ErrCodeProtocol}
+ }
req := &http.Request{
Method: rp.method,
- URL: &url.URL{},
+ URL: url,
RemoteAddr: sc.conn.RemoteAddr().String(),
Header: rp.header,
RequestURI: rp.path,