Skip to content

net/url: do not URL-escape auth info before base64 encoding #5970

@dustin

Description

@dustin
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.

A good example is this:  http://play.golang.org/p/3bwbg8LLGE

What is the expected output?

The encoding according to the RFC is as follows:

      basic-credentials = base64-user-pass
      base64-user-pass  = <base64 [4] encoding of user-pass,
                       except not limited to 76 char/line>
      user-pass   = userid ":" password
      userid      = *<TEXT excluding ":">
      password    = *TEXT

In particular, you do not encode the username and password, just split on ':' -- the
only special bit is that the username isn't allowed to have a : itself.

Then the entire thing is base64 encoded.

What do you see instead?

URL escaped stuff.

Which compiler are you using (5g, 6g, 8g, gccgo)?

8g

Which operating system are you using?

OSX/Linux

Which version are you using?  (run 'go version')

1.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeSuggestedIssues that may be good for new contributors looking for work to do.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions