Description
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.
We 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, we see that an explicit check is being made for a prefix of //
and the Scheme is appended. This was added for issue #4860.
The issue #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.
If 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.
Reference issue: cloudfoundry/gorouter#60