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

Unified Diff: chrome/browser/resources/net_internals/log_view_painter.js

Issue 1360253002: Log GOAWAY frame debug data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize |goaway_count_|. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/net_internals/log_view_painter.js » ('j') | net/http/http_log_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/net_internals/log_view_painter.js
diff --git a/chrome/browser/resources/net_internals/log_view_painter.js b/chrome/browser/resources/net_internals/log_view_painter.js
index bbfaae415bc3c37af56737491766a434be474399..0f80978bc9881cac35ad53a0e0a9c9c93fe6590b 100644
--- a/chrome/browser/resources/net_internals/log_view_painter.js
+++ b/chrome/browser/resources/net_internals/log_view_painter.js
@@ -479,6 +479,9 @@ function reformatHeaders(entry) {
* Removes a cookie or unencrypted login information from a single HTTP header
* line, if present, and returns the modified line. Otherwise, just returns
* the original line.
+ *
+ * Note: this logic should be kept in sync with
+ * net::ElideHeaderValueForNetLog in net/http/http_log_util.cc.
*/
function stripCookieOrLoginInfo(line) {
var patterns = [
@@ -545,16 +548,40 @@ function stripCookieOrLoginInfo(line) {
}
/**
+ * Remove debug data from HTTP/2 GOAWAY frame due to privacy considerations, see
+ * https://httpwg.github.io/specs/rfc7540.html#GOAWAY.
+ *
+ * Note: this logic should be kept in sync with
+ * net::ElideGoAwayDebugDataForNetLog in net/http/http_log_util.cc.
+ */
+function stripGoAwayDebugData(value) {
+ return '[' + value.length + ' bytes were stripped]';
+}
+
+/**
* If |entry| has headers, returns a copy of |entry| with all cookie and
* unencrypted login text removed. Otherwise, returns original |entry| object.
* This is needed so that JSON log dumps can be made without affecting the
* source data. Converts headers stored in objects to arrays.
- *
- * Note: this logic should be kept in sync with
- * net::ElideHeaderForNetLog in net/http/http_log_util.cc.
*/
stripCookiesAndLoginInfo = function(entry) {
eroman 2015/10/06 17:19:41 This function name doesn't seem accurate anymore,
Bence 2015/10/07 15:18:27 I renamed this function and added TODO to capture
- if (!entry.params || entry.params.headers === undefined ||
+ if (!entry.params) {
+ return entry;
+ }
+
+ if (entry.type == EventType.HTTP2_SESSION_GOAWAY &&
+ entry.params.debug_data != undefined) {
+ // Duplicate the top level object, and |entry.params|. All other fields are
+ // just pointers to the original values, as they won't be modified, other
+ // than |entry.params.debug_data|.
+ entry = shallowCloneObject(entry);
+ entry.params = shallowCloneObject(entry.params);
+ entry.params.debug_data =
+ stripGoAwayDebugData(entry.params.debug_data);
+ return entry;
+ }
+
+ if (entry.params.headers === undefined ||
!(entry.params.headers instanceof Object)) {
return entry;
}
« no previous file with comments | « no previous file | chrome/test/data/webui/net_internals/log_view_painter.js » ('j') | net/http/http_log_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698