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

Comments

Projects
None yet
3 participants
@jmhodges
Copy link
Contributor

commented Apr 27, 2015

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

This comment has been minimized.

Copy link
Member

commented Apr 27, 2015

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 27, 2015

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

This comment has been minimized.

Copy link
Member

commented Apr 27, 2015

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

@jmhodges

This comment has been minimized.

Copy link
Contributor Author

commented Apr 27, 2015

@jmhodges

This comment has been minimized.

Copy link
Contributor Author

commented Apr 27, 2015

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.

@jmhodges jmhodges closed this Apr 27, 2015

@bradfitz

This comment has been minimized.

Copy link
Member

commented Apr 27, 2015

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.
You can’t perform that action at this time.