| 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 "net/http/http_auth_challenge_tokenizer.h" | 11 #include "net/http/http_auth_challenge_tokenizer.h" |
| 11 #include "net/http/http_auth_scheme.h" | 12 #include "net/http/http_auth_scheme.h" |
| 12 #include "net/http/http_util.h" | 13 #include "net/http/http_util.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 bool ShouldRedactChallenge(HttpAuthChallengeTokenizer* challenge) { | 19 bool ShouldRedactChallenge(HttpAuthChallengeTokenizer* challenge) { |
| 19 // Ignore lines with commas, as they may contain lists of schemes, and | 20 // Ignore lines with commas, as they may contain lists of schemes, and |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Note: this logic should be kept in sync with stripGoAwayDebugData in | 81 // Note: this logic should be kept in sync with stripGoAwayDebugData in |
| 81 // chrome/browser/resources/net_internals/log_view_painter.js. | 82 // chrome/browser/resources/net_internals/log_view_painter.js. |
| 82 if (capture_mode.include_cookies_and_credentials()) { | 83 if (capture_mode.include_cookies_and_credentials()) { |
| 83 return debug_data.as_string(); | 84 return debug_data.as_string(); |
| 84 } | 85 } |
| 85 | 86 |
| 86 return std::string("[") + base::SizeTToString(debug_data.size()) + | 87 return std::string("[") + base::SizeTToString(debug_data.size()) + |
| 87 std::string(" bytes were stripped]"); | 88 std::string(" bytes were stripped]"); |
| 88 } | 89 } |
| 89 | 90 |
| 91 std::unique_ptr<base::ListValue> ElideSpdyHeaderBlockForNetLog( |
| 92 const SpdyHeaderBlock& headers, |
| 93 NetLogCaptureMode capture_mode) { |
| 94 std::unique_ptr<base::ListValue> headers_list(new base::ListValue()); |
| 95 for (SpdyHeaderBlock::const_iterator it = headers.begin(); |
| 96 it != headers.end(); ++it) { |
| 97 headers_list->AppendString( |
| 98 it->first.as_string() + ": " + |
| 99 ElideHeaderValueForNetLog(capture_mode, it->first.as_string(), |
| 100 it->second.as_string())); |
| 101 } |
| 102 return headers_list; |
| 103 } |
| 104 |
| 90 } // namespace net | 105 } // namespace net |
| OLD | NEW |