| Index: net/http/http_auth.cc
|
| diff --git a/net/http/http_auth.cc b/net/http/http_auth.cc
|
| index 552d2457abf9b48db5f4cab1bd399f7001b20cb3..d5d6e0c430f40b424c15099a2654e0d2593cb2da 100644
|
| --- a/net/http/http_auth.cc
|
| +++ b/net/http/http_auth.cc
|
| @@ -87,6 +87,24 @@ HttpAuth::AuthorizationResult HttpAuth::HandleChallengeResponse(
|
| return HttpAuth::AUTHORIZATION_RESULT_REJECT;
|
| }
|
|
|
| +HttpUtil::NameValuePairsIterator HttpAuth::ChallengeTokenizer::param_pairs()
|
| + const {
|
| + return HttpUtil::NameValuePairsIterator(params_begin_, params_end_, ',');
|
| +}
|
| +
|
| +std::string HttpAuth::ChallengeTokenizer::base64_param() const {
|
| + // Strip off any padding.
|
| + // (See https://bugzilla.mozilla.org/show_bug.cgi?id=230351.)
|
| + //
|
| + // Our base64 decoder requires that the length be a multiple of 4.
|
| + int encoded_length = params_end_ - params_begin_;
|
| + while (encoded_length > 0 && encoded_length % 4 != 0 &&
|
| + params_begin_[encoded_length - 1] == '=') {
|
| + --encoded_length;
|
| + }
|
| + return std::string(params_begin_, params_begin_ + encoded_length);
|
| +}
|
| +
|
| void HttpAuth::ChallengeTokenizer::Init(std::string::const_iterator begin,
|
| std::string::const_iterator end) {
|
| // The first space-separated token is the auth-scheme.
|
| @@ -107,24 +125,6 @@ void HttpAuth::ChallengeTokenizer::Init(std::string::const_iterator begin,
|
| HttpUtil::TrimLWS(¶ms_begin_, ¶ms_end_);
|
| }
|
|
|
| -HttpUtil::NameValuePairsIterator HttpAuth::ChallengeTokenizer::param_pairs()
|
| - const {
|
| - return HttpUtil::NameValuePairsIterator(params_begin_, params_end_, ',');
|
| -}
|
| -
|
| -std::string HttpAuth::ChallengeTokenizer::base64_param() const {
|
| - // Strip off any padding.
|
| - // (See https://bugzilla.mozilla.org/show_bug.cgi?id=230351.)
|
| - //
|
| - // Our base64 decoder requires that the length be a multiple of 4.
|
| - int encoded_length = params_end_ - params_begin_;
|
| - while (encoded_length > 0 && encoded_length % 4 != 0 &&
|
| - params_begin_[encoded_length - 1] == '=') {
|
| - --encoded_length;
|
| - }
|
| - return std::string(params_begin_, params_begin_ + encoded_length);
|
| -}
|
| -
|
| // static
|
| std::string HttpAuth::GetChallengeHeaderName(Target target) {
|
| switch (target) {
|
|
|