New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 764946 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

DevTools: Protocol's encodedDataLength includes headers size

Project Member Reported by lushnikov@chromium.org, Sep 13 2017

Issue description

Chrome Version       : 60.0.3112.113

The protocol's "encodedDataLength", reported in Network.RequestFinished event, includes raw headers size, 
which it should not as far as the naming goes.

There's already a code that seems to be subtracting headers which apparently doesn't work: https://cs.chromium.org/chromium/src/content/browser/loader/async_resource_handler.cc?sq=package:chromium&l=286

Reproduction case:
- try serving an empty page and check it's "size" in devtools network panel

Downstream issue in puppeteer: https://github.com/GoogleChrome/puppeteer/issues/667
 

Comment 1 by caseq@chromium.org, Sep 22 2017

Cc: dgozman@chromium.org pfeldman@chromium.org allada@chromium.org
Status: WontFix (was: Assigned)
Though we agreed this is by design and you can just subtract the length of raw headers?  I guess changing the semantic of a field in a stable and widely used protocol event is going to break a lot of clients. Please reopen if disagree.
Apologies for posting on a closed issue, but I’m trying to work around the downstream issue in Puppeteer by subtracting the length of raw headers as suggested here and am running into a problem.

It seems straightforward enough to subtract `Response.headersText.length` from `encodedDataLength` (assuming headers are ASCII, which seems safe enough 99% of the time, but is there a way not to make that assumption?). However, for HTTP/2 responses, `Response.headersText` is not present (it might be helpful to note that in the protocol viewer). I have a few questions in that case:

1. This seems reasonable since HTTP/2 headers are a special binary format and so have no canonical text representation. Is that correct, or is this a bug? (Happy to file one here if so.)

2. In this case (HTTP/2 responses), are the headers still included in `encodedDataLength`?

3. If yes to #2, how should I be calculating their size so I can subtract them from the overall `encodedDataLength` to get the response body bytes?

Sorry if there’s somewhere obvious I should be looking for these answers in the Chromium source; I’m not familiar enough with it and don’t really know where to check.

Sign in to add a comment