| 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;
|
| }
|
|
|