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

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: Nit. 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
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 4b29de3994db9154a66536ad657211c91b468e1e..87f5ef58188396c94449c27fbe9300328b520d3c 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 = [
@@ -547,16 +550,39 @@ 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) {
- if (!entry.params || entry.params.headers === undefined ||
+ if (!entry.params) {
+ return entry;
+ }
+
+ if (entry.params.goaway_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.goaway_debug_data|.
+ entry = shallowCloneObject(entry);
+ entry.params = shallowCloneObject(entry.params);
+ entry.params.goaway_debug_data =
+ stripGoAwayDebugData(entry.params.goaway_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/spdy/buffered_spdy_framer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698