Skip to content
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

net/http: requests with empty paths redirect instead of 200 #10586

Closed
jmhodges opened this issue Apr 27, 2015 · 6 comments
Closed

net/http: requests with empty paths redirect instead of 200 #10586

jmhodges opened this issue Apr 27, 2015 · 6 comments

Comments

@jmhodges
Copy link
Contributor

Requests to "http://example.com" (no trailing slash) always redirect to "http://example.com/" even if there is a "/" handler available. Other servers will match the lack of path with the "/" handler as expected.

@bradfitz
Copy link
Contributor

More info please.

It's unclear whether you mean your browser doing this (in which case it's not even a redirect), or ServeMux, etc. And if ServeMux, with or without hostnames in the pattern.

@jmhodges
Copy link
Contributor Author

The browsers and curl are doing it. It happens with both hostnames and no hostname in the pattern. I have a patch to propose.

@bradfitz
Copy link
Contributor

I still don't understand so I'm curious to see your patch.

@jmhodges
Copy link
Contributor Author

@jmhodges
Copy link
Contributor Author

This is a problem in using NewRequest in the tests, not here. Confirmation I thought I had done was not done. Sorry for the noise.

@bradfitz
Copy link
Contributor

There's an open documentation bug for that already.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants