{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/14952","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/14952/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/14952/comments","events_url":"https://api.github.com/repos/golang/go/issues/14952/events","html_url":"https://github.com/golang/go/issues/14952","id":143387876,"number":14952,"title":"net/url: No way to completely control the Request URI generated for an HTTP request","user":{"login":"crhino","id":4146455,"avatar_url":"https://avatars.githubusercontent.com/u/4146455?v=3","gravatar_id":"","url":"https://api.github.com/users/crhino","html_url":"https://github.com/crhino","followers_url":"https://api.github.com/users/crhino/followers","following_url":"https://api.github.com/users/crhino/following{/other_user}","gists_url":"https://api.github.com/users/crhino/gists{/gist_id}","starred_url":"https://api.github.com/users/crhino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crhino/subscriptions","organizations_url":"https://api.github.com/users/crhino/orgs","repos_url":"https://api.github.com/users/crhino/repos","events_url":"https://api.github.com/users/crhino/events{/privacy}","received_events_url":"https://api.github.com/users/crhino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-24T23:33:37Z","updated_at":"2016-04-01T11:48:17Z","closed_at":null,"body":"We are writing a reverse proxy that we want to be completely transparent in terms of the HTTP request URI. If a client sends an invalid Request URI, we want to forward it on as is and not modify it in any way.\r\n\r\nWe have been able to almost achieve this goal using the `url.Opaque` field, expect for http requests starting with `//`. In the URL.RequestURI() method [here](https://github.com/golang/go/blob/3afbb690d5dd87949c87a8dd8d88cb4f3489f644/src/net/url/url.go#L919-L921), we see that an explicit check is being made for a prefix of `//` and the Scheme is appended. This was added for issue https://github.com/golang/go/issues/4860.\r\n\r\nThe issue https://github.com/golang/go/issues/10433 mentions a workaround for the specific usecase of `//`, but using `RawPath` makes `URL.RequestURI()` return a url-encoded RequestURI through the use of `EscapedPath()`. This is also a violation of our goal of transparency.\r\n\r\nIf there is another workaround that we are not aware, help finding that out would be appreciated, otherwise we would ask whether or not this is a feature the Go developers would support.\r\n\r\nReference issue: https://github.com/cloudfoundry/gorouter/issues/60\r\n\r\n@crhino && @shashwathi"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/204362428","html_url":"https://github.com/golang/go/issues/14952#issuecomment-204362428","issue_url":"https://api.github.com/repos/golang/go/issues/14952","id":204362428,"user":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T11:48:16Z","updated_at":"2016-04-01T11:48:16Z","body":"What I can't quickly find reading https://github.com/cloudfoundry/gorouter/issues/60 is why this matters. \r\n\r\nWhat client is generating `GET //foo` paths?\r\nWhat server is requiring `//foo` requests?\r\n"}}