Skip to content

Commit

Permalink
Hide content.size from response if it’s -1.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobli committed Feb 8, 2017
1 parent 7262da6 commit 69f9556
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ts/waterfall/details-overlay/extract-details-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ function parseResponseDetails(harEntry: Entry): KvTuple[] {
};

const contentLength = getHeader(headers, "Content-Length");
let contentSize = undefined;
if (content.size !== -1 && contentLength !== content.size.toString()) {
contentSize = content.size;
}

let contentType = getHeader(headers, "Content-Type");
if (harEntry._contentType && harEntry._contentType !== contentType) {
Expand All @@ -104,7 +108,7 @@ function parseResponseDetails(harEntry: Entry): KvTuple[] {
dateHeader("Last-Modified"),
stringHeader("Pragma"),
byteSizeProperty("Content-Length", contentLength),
["Content Size", (contentLength !== content.size.toString() ? formatBytes(content.size) : undefined)],
byteSizeProperty("Content Size", contentSize),
byteSizeProperty("Content Compression", content.compression),
stringHeader("Connection"),
stringHeader("ETag"),
Expand Down

0 comments on commit 69f9556

Please sign in to comment.