Skip to content

Commit

Permalink
Update comment on HTTP Basic authentication encoding
Browse files Browse the repository at this point in the history
Replace a TODO comment with a bit of information about cross-browser
compatibility of the character encoding used in HTTP Basic credentials.

Change-Id: I91160cd3c1d7401044fddd7a03c7a42d71bb4f05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2453470
Reviewed-by: Eric Roman <eroman@chromium.org>
Commit-Queue: Eric Lawrence [MSFT] <ericlaw@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#814455}
  • Loading branch information
Eric Lawrence authored and Commit Bot committed Oct 6, 2020
1 parent c5218bd commit 63769f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/http/http_auth_handler_basic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ int HttpAuthHandlerBasic::GenerateAuthTokenImpl(
CompletionOnceCallback callback,
std::string* auth_token) {
DCHECK(credentials);
// TODO(eroman): is this the right encoding of username/password?
// Firefox, Safari and Chromium all use UTF-8 encoding; IE uses iso-8859-1.
// RFC7617 does not specify a default encoding, but UTF-8 is the only allowed
// value for the optional charset parameter on the challenge.
std::string base64_username_password;
base::Base64Encode(base::UTF16ToUTF8(credentials->username()) + ":" +
base::UTF16ToUTF8(credentials->password()),
Expand Down

0 comments on commit 63769f3

Please sign in to comment.