Skip to content

Commit 69f9556

Browse files
committed
Hide content.size from response if it’s -1.
1 parent 7262da6 commit 69f9556

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/ts/waterfall/details-overlay/extract-details-keys.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ function parseResponseDetails(harEntry: Entry): KvTuple[] {
8585
};
8686

8787
const contentLength = getHeader(headers, "Content-Length");
88+
let contentSize = undefined;
89+
if (content.size !== -1 && contentLength !== content.size.toString()) {
90+
contentSize = content.size;
91+
}
8892

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

0 commit comments

Comments
 (0)