http://golang.org/src/pkg/net/url/url.go#692The url.go package prepends the scheme to RequestUri when the Path begins with "//". In our situation, we are trying to write a transparent proxy that does not modify the path. Since this is in a http server included in the golang core, perhaps it would better be not to add these smarter corrections and instead leave it to those writing more adapted servers out there. Do you think this is reasonable default behavior?
At the risk of sounding pedantic, package url is not an http server.
Given that you can't do an HTTP request with "//foo" (see RFC 2616 5.1.2 Request-URI), it seems best to prepend the scheme to make it an absoluteURI.
Request-URI = "*" | absoluteURI | abs_path | authority
abs_path = "/" path_segmentspath_segments = segment *( "/" segment ) segment = *pchar *( ";" param )
request-line = method SP request-target SP HTTP-version CRLF request-target = origin-form / absolute-form / authority-form / asterisk-form
origin-form = absolute-path [ "?" query ]
absolute-path = 1*( "/" segment ) [...] An
"absolute-path" rule is defined for protocol elements that can contain a non-empty path component. (This rule differs slightly from the path-abempty rule of RFC 3986, which allows for an empty path to be used in references, and path-absolute rule, which does not allow paths that begin with "//".)