Skip to content

net/http: NewRequest surprising behaviour with escaped forward slashes #11991

Closed
@samcday

Description

@samcday

What version of Go are you using (go version)?
go version go1.4.2 darwin/amd64

What operating system and processor architecture are you using?
OSX Mavericks 10.10.4

What did you do?
I tried to issue a HTTP request using http.NewRequest like this:

req, _ := http.NewRequest("GET", "http://example.com/encoded%2fslashes", nil)

What did you expect to see?
I expected to see a request fired to the remote server with a path of /encoded%2fslashes.

What did you see instead?
A request was fired to the remote server with a path of /encoded/slashes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions