-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.8
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
amd64 linux
What did you do?
Although RFC 2617 section 2 seems to specify that a basic auth header should be in the format "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", with the first letter of "basic" capitalized, this is not explicitly stated.
parseBasicAuth() requires "Basic". While this may be correct, many clients send "BASIC QWxhZGRpbjpvcGVuIHNlc2FtZQ==". This was changed in Rails in 2015, for instance.
That issue incorrectly uses RFC 2617 section 1 as justification, but as section 2 does not explicitly require Basic this seems like something that should be changed in order to offer the broadest compatibility with clients.
What did you expect to see?
With BASIC QWxhZGRpbjpvcGVuIHNlc2FtZQ==, r.BasicAuth() returns "Aladdin", "open sesame", true
What did you see instead?
With BASIC QWxhZGRpbjpvcGVuIHNlc2FtZQ==, r.BasicAuth() returns "", "", false