Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: net/http/http_log_util.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_auth_sspi_win.cc ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_log_util.h" 5 #include "net/http/http_log_util.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "net/http/http_auth_challenge_tokenizer.h" 9 #include "net/http/http_auth_challenge_tokenizer.h"
10 #include "net/http/http_util.h" 10 #include "net/http/http_util.h"
11 11
12 namespace net { 12 namespace net {
13 13
14 namespace { 14 namespace {
15 15
16 bool ShouldRedactChallenge(HttpAuthChallengeTokenizer* challenge) { 16 bool ShouldRedactChallenge(HttpAuthChallengeTokenizer* challenge) {
17 // Ignore lines with commas, as they may contain lists of schemes, and 17 // Ignore lines with commas, as they may contain lists of schemes, and
18 // the information we want to hide is Base64 encoded, so has no commas. 18 // the information we want to hide is Base64 encoded, so has no commas.
19 if (challenge->challenge_text().find(',') != std::string::npos) 19 if (challenge->challenge_text().find(',') != std::string::npos)
20 return false; 20 return false;
21 21
22 std::string scheme = StringToLowerASCII(challenge->scheme()); 22 std::string scheme = base::StringToLowerASCII(challenge->scheme());
23 // Invalid input. 23 // Invalid input.
24 if (scheme.empty()) 24 if (scheme.empty())
25 return false; 25 return false;
26 26
27 // Ignore Basic and Digest authentication challenges, as they contain 27 // Ignore Basic and Digest authentication challenges, as they contain
28 // public information. 28 // public information.
29 if (scheme == "basic" || scheme == "digest") 29 if (scheme == "basic" || scheme == "digest")
30 return false; 30 return false;
31 31
32 return true; 32 return true;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (redact_begin == redact_end) 91 if (redact_begin == redact_end)
92 return value; 92 return value;
93 93
94 return std::string(value.begin(), redact_begin) + 94 return std::string(value.begin(), redact_begin) +
95 base::StringPrintf("[%ld bytes were stripped]", 95 base::StringPrintf("[%ld bytes were stripped]",
96 static_cast<long>(redact_end - redact_begin)) + 96 static_cast<long>(redact_end - redact_begin)) +
97 std::string(redact_end, value.end()); 97 std::string(redact_end, value.end());
98 } 98 }
99 99
100 } // namespace net 100 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_sspi_win.cc ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698