| OLD | NEW |
| 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_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "net/http/http_auth_challenge_tokenizer.h" | 11 #include "net/http/http_auth_challenge_tokenizer.h" |
| 12 #include "net/http/http_auth_scheme.h" | 12 #include "net/http/http_auth_scheme.h" |
| 13 #include "net/http/http_util.h" | 13 #include "net/http/http_util.h" |
| 14 #include "net/log/net_log_capture_mode.h" |
| 14 | 15 |
| 15 namespace net { | 16 namespace net { |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| 19 bool ShouldRedactChallenge(HttpAuthChallengeTokenizer* challenge) { | 20 bool ShouldRedactChallenge(HttpAuthChallengeTokenizer* challenge) { |
| 20 // Ignore lines with commas, as they may contain lists of schemes, and | 21 // Ignore lines with commas, as they may contain lists of schemes, and |
| 21 // the information we want to hide is Base64 encoded, so has no commas. | 22 // the information we want to hide is Base64 encoded, so has no commas. |
| 22 if (challenge->challenge_text().find(',') != std::string::npos) | 23 if (challenge->challenge_text().find(',') != std::string::npos) |
| 23 return false; | 24 return false; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 it != headers.end(); ++it) { | 97 it != headers.end(); ++it) { |
| 97 headers_list->AppendString( | 98 headers_list->AppendString( |
| 98 it->first.as_string() + ": " + | 99 it->first.as_string() + ": " + |
| 99 ElideHeaderValueForNetLog(capture_mode, it->first.as_string(), | 100 ElideHeaderValueForNetLog(capture_mode, it->first.as_string(), |
| 100 it->second.as_string())); | 101 it->second.as_string())); |
| 101 } | 102 } |
| 102 return headers_list; | 103 return headers_list; |
| 103 } | 104 } |
| 104 | 105 |
| 105 } // namespace net | 106 } // namespace net |
| OLD | NEW |