Glimpse / Home

Project Glimpse: Node Edition - Spend less time debugging and more time developing.
http://node.getglimpse.com
Other
252 stars 9 forks source link

[Response] The Connection and Date response headers aren't being displayed #17

Closed lostintangent closed 7 years ago

lostintangent commented 8 years ago

Repro Steps:

  1. Generate a request for a document (it might impact AJAX requests as well, but I didn't test that)
  2. Within the Glimpse client, select the request entry you just generated
  3. Look at the response headers

Expected: To see a Connection and Date header, which confirmed in both Chrome DevTools are Fiddler are actually present present.

fiddler

Actual: Every request and response header is correctly displayed, except for the Connection and Date response headers.

glimpseresponse

This is a pretty low-priority bug from my perspective, but I was confused when I didn't see these headers in Glimpse, and so I jumped to other tools to confirm. When I had worked on the F12 network tool, we had a lot of customers that would "cross check" us against Chrome and Fiddler to gain confidence in the data, so these kinds of mismatches can be meaningful sometimes to try to address.

Environment:

nikmd23 commented 8 years ago

Thanks for this report @lostintangent. We need to make sure that our data is accurate, so this is a good pick up.,

philliphoff commented 8 years ago

The issue here is that the Node.js runtime implicitly generates the Date and Connection headers after the call to res.writeHead() (see _storeHeader) and does not use the same public API used by applications for setting headers. This means our existing patches of the req object do not capture these headers.

These headers do end up in the internal req._header property (a formatted string of all written headers) which should be populated by the finish event. We might add a function to the ResponseHelper object--normally attached to reach request and fires events as headers are set--that returns all headers in req._header that haven't yet been seen by the listener. The listener would call this during the finish event to ensure it has the entire list. However, even aside from the awkwardness of the API, that approach would rely on Node.js runtime internals that may not be the same across versions.

davidkpiano commented 7 years ago

Confirmed:

screen shot 2017-05-25 at 5 29 15 pm
mike-kaufman commented 7 years ago

Fix for this is availabe on NPM now with glimpse version 0.21.5.