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

http.Server redirects to / on a URL with two (but not three or four) leading slashes, such as GET //myfile HTTP/1.1 #900

Closed
mikebell-org opened this issue Jul 2, 2010 · 2 comments

Comments

@mikebell-org
Copy link

Set yourself up an http.Server example, telnet to it and issue a GET with a double-slash
in the lead (or just visit in in your browser with a double-slash URL such as
http://myhost//myfile). It will redirect you to / instead of to /myfile. /// or ////
redirect as expected however.

The problem seems to be in ParseURL:
        // Maybe path is //authority/path
        if len(path) > 2 && path[0:2] == "//" {
                url.Authority, path = split(path[2:], '/', false)
        }
@adg
Copy link
Contributor

adg commented Jul 5, 2010

Comment 1:

Labels changed: added packagebug.

Owner changed to a...@golang.org.

Status changed to Accepted.

@adg
Copy link
Contributor

adg commented Jul 12, 2010

Comment 2:

This issue was closed by revision 880beaf.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc unassigned adg Jun 22, 2022
This issue was closed.
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