Wrong bodySize (and feature request: add _transferSize)
See original GitHub issueI’m test-running timing-fix
branch code, found there are still a few fields missing from this chrome-har-capturer than a real Chrome DevTools, one is request headers, I can only see Referer
and User-Agent
while a real Chrome DevTools gives all headers sent in full, like Host: ...
, Accept-Encoding: ...
and others, I haven’t looked at the chrome remote debugging protocol, not even sure if remote-interface ever provided those, or can it be done in this chrome-har-capturer ??
"headers": [
{
"name": "Referer",
"value": "http://www.podcastone.com/widgetrecent?progID=877"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2716.0 Safari/537.36"
}
],
Another one I found from a real Chrome DevTools is the _transferSize
; when in transfer-encoding: chunked
mode, the response is (a length + a chunk) + (length + chunk) + … + 0; so the real transferred bytes on the wire could be slightly larger than bodySize
; I’m not sure which har viewer ever take use of the _transferSize
but it can be used in real bandwith calculation or something, and it’s missing from this chrome-har-capturer
"content": {
"size": 118465,
"mimeType": "text/html",
"compression": 96200
},
"redirectURL": "",
"headersSize": 662,
"bodySize": 22265,
"_transferSize": 22927
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
So to summarize, the header problem is fixed now. While the
bodySize
(i.e., the on the wire body size) is reported incorrectly by Chrome. For example:Which is also the value reported in the
Content-Length
header, is the correct one. While the HAR reports:Compared to the HAR generated by DevTools directly:
Note that in both cases
compression
satisfies:OK, fixed. It seems that
encodedDataLength
represents the encoded payload plus the headers. I also added_transferSize
.