Skip to content

net/http: document the behavior of %2F in url strings #8450

Closed
@gopherbot

Description

@gopherbot

by david.schmiddi.86:

What does 'go version' print?
go version go1.3 windows/amd64

What steps reproduce the problem?
http://play.golang.org/p/ZOqHmlFaU8

1. http.Get("https://example.com/search/Alive+%2F%2F+Well/true";)

What happened?
404

What should have happened instead?
200
The parameter is a string, it should not modify my provided url. I should care about
escaping myself or at least given an option or hint what is magically happening behind
the scenes.

Please provide any additional information below.

I stumbled across this on accident and after I finally found the flaw, I found a lot of
older issues and an updated note about this unexpected behavior in another package:
http://golang.org/pkg/net/url/#URL

It should be documented in net/http, that it uses net/url to parse, decode and reencode
the string url parameters and that %2F is going to be lost. I'd even document the
solution for users who need %2F support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions