-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parseURL() seems to lose the Host as its using Opaque instead of Path? #147
Comments
Opaque is intentionally set to work around a long-standing bug in net/url. What is the specific error that you encountered? Did the client fail to connect to the correct host and port? |
Ah ok thanks! Yeah I was seeing the host/port zapped from the URL so figured it was a bug. Though maybe it only looks like a bug in that the host name is in the URL; it just never appears if you use url.String()? |
The workaround breaks URL.String(). |
Are you accessing the URL from a proxy function or from resp.Request.URL where resp is the second return value from Dialer.Dial? Is it important that String() print the correct URL? The net/url bug is fixed in Go 1.6. I plan to replace parseURL with the standard net/url parser when all users of the package move to Go 1.6 or later. That's probably two or three years. |
TBH I think this was probably me thinking there was a bug as I was seeing the host/port disappear in logging output (due to how String() doesn't show host if opaque is set); when it probably doesn't affect the actual behaviour of the code. So lets close I think! Sorry for the noise |
while using websocket I was finding the host and port were getting stripped from the URL I was using. It looks like the parseURL() function is updating the Opaque value rather than the Path; was that intentional? A PR is on its way if it helps
The text was updated successfully, but these errors were encountered: