Skip to content

Commit

Permalink
If we receive an HTTP authentication header with a non-ASCII
Browse files Browse the repository at this point in the history
realm string, the ASCIIToWide call in PopulateAuthChallenge
hits a DCHECK failure.  Change the ASCIIToWide call to a
base::SysNativeMBToWide call, which produces the correct
result when the OS "language for non-Unicode programs" is set
to the language of the realm string.

R=darin,jungshik
BUG=1348130

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1504 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
wtc@google.com committed Aug 28, 2008
1 parent da641c9 commit 6457ac4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/http/http_transaction_winhttp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1522,13 +1522,13 @@ void HttpTransactionWinHttp::PopulateAuthChallenge() {
return;

// TODO(darin): Need to support RFC 2047 encoded realm strings. For now, we
// just match Mozilla and limit our support to ASCII realm strings.
std::wstring auth_header = ASCIIToWide(header_value);
// limit our support to ASCII and "native code page" realm strings.
std::wstring auth_header = base::SysNativeMBToWide(header_value);

// auth_header is a string which looks like:
// Digest realm="The Awesome Site", domain="/page.html", ...
std::wstring::const_iterator space = find(auth_header.begin(),
auth_header.end(), ' ');
auth_header.end(), L' ');
auth_info->scheme.assign(auth_header.begin(), space);
auth_info->realm = GetHeaderParamValue(auth_header, L"realm");

Expand Down

0 comments on commit 6457ac4

Please sign in to comment.