Closed lostintangent closed 7 years ago
Thanks for this report @lostintangent. We need to make sure that our data is accurate, so this is a good pick up.,
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.
Confirmed:
Fix for this is availabe on NPM now with glimpse version 0.21.5.
Repro Steps:
Expected: To see a
Connection
andDate
header, which confirmed in both Chrome DevTools are Fiddler are actually present present.Actual: Every request and response header is correctly displayed, except for the
Connection
andDate
response headers.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: