Releases: exogen/node-fetch-har
Releases · exogen/node-fetch-har
v1.0.1
Bug Fix
- Socket event listeners (
lookup
,connect
,secureConnect
) are now attached withonce
and explicitly removed on requestfinish
. This fixes listeners from sticking around on sockets that end up being reused (for example, with agentkeepalive’s socket pooling.
v1.0.0
v1.0.0-rc.3
Enhancement
- Set the
_resourceType
field tofetch
so that requests are categorized under XHR/Fetch in common HAR viewers (like Chrome or Firefox’s Network tab).
Internal
- Use
URL.createObjectURL
to generate the HAR download link in the Next.js demo. This is preferable because it allows the data to be of any size.
v1.0.0-rc.2
New Feature
-
Custom agents! If you pass a custom
agent
tofetch
(as supported bynode-fetch
) it will be instrumented with HAR tracking behavior. This allows you to use helpers like agentkeepalive.If you are using the custom agent outside of
withHar
contexts as well, this instrumentation should have no adverse effects and will be disabled unless invoked bywithHar
specifically (since it adds a special header).
Enhancements
- If not using a custom agent (see above), the HAR tracking agent instances created by
withHar
are now shared globally, instead of created for eachwithHar
instance.
v1.0.0-rc.1
Enhancement
- Gracefully handle bogus
Set-Cookie
response headers instead of throwing an error. The header will still appear inheaders
, but nocookies
will be added from it.
v0.9.0
v0.8.0
v0.7.0
New Feature
- Support for compression savings info via the
compression
field.
Enhancement
- Sizes are now calculated with
Buffer.byteLength
instead of stringlength
where possible. - Use high resolution timestamps via
process.hrtime
. - More accurately determine the
send
duration by listening for the ClientRequest’sfinish
event. In practice, most of this time is actually going to be attributable to DNS/connect/SSL/etc. but it’s better than nothing for now.
v0.6.0
New Feature
- Support for redirects. When Fetch is configured to transparently follow redirects (the default), multiple HAR entries will be emitted. See the Redirects section of the README.
- Support for request body info. See the Request Body section of the README.
v0.5.0
Bug Fix
- Fix an issue on some versions of
node-fetch
where the constructor of the returnedresponse
is notResponse
, but rather a differentBody
class that does not set the same properties. This caused our cloned response instance to not have aheaders
property. Now, we check the input Fetch instance for aResponse
property (likenode-fetch
does) or try to get it fromglobal
(likeisomorphic-fetch
does) before falling back toresponse.constructor
. To fully override the class (for more complicated scenarios), use the newResponse
option towithHar
.
Internal
- Add real tests using Jest. All of
node-fetch
,isomorphic-fetch
, andisomorphic-unfetch
are tested. Even though they all usenode-fetch
,isomorphic-fetch
uses an old version, and we may need to test additional integration points (like what properties exist on the default export).