Releases: mswjs/interceptors
Releases · mswjs/interceptors
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
Bug fixes
- Fixes an issue that resulted into middleware exceptions not being handled properly in
XMLHttpRequest
instances (mswjs/msw#355, #54). Now any middleware exception first triggers theerror
event, and only then theabort
event.
v0.5.0
Breaking changes
- Internal: Changes the handling of the original (unpatched)
http.ClientRequest
class by moving it reference out of theClientRequestOverride
class and restoring it as a part of each individual request handling (#50).
Bug fixes
- Fixes an issue that resulted into "The superCtor argument must be of type function" error during request interception (#49).
v0.4.0
Breaking changes
- Creating a new
RequestInterceptor
instance now requires to pass a list of interceptors to use. It's recommended to use the/presets/default
interceptors preset for backwards-compatibility.
import { RequestInterceptor } from 'node-request-interceptor'
+import withDefaultInterceptors from 'node-request-interceptor/presets/default'
-new RequestInterceptor()
+new RequestInterceptor(withDefaultInterceptors)
Features
-
Supports granular interceptors configuration (#48), allowing to specify which request issuing modules to intercept on the usage level. The list of published interceptors:
node-request-interceptor/interceptors/ClientRequest
node-request-interceptor/interceptors/XMLHttpRequest
To use one or multiple interceptors import them and provide as an argument to RequestInterceptor
class:
import { RequestInterceptor } from 'node-request-interceptor'
import { interceptXMLHttpRequest } from 'node-request-interceptor/interceptors/XMLHttpRequest'
const interceptor = new RequestInterceptor([interceptXMLHttpRequest])
interceptor.use(/* refer to README for usage examples */)
Bug fixes
v0.3.6
Changes
ClientRequest
options.uri.protocol
is taken into account when deciding on the request's protocol.
XMLHttpRequest
this.user
andthis.password
initializers are now removed, the values default toundefined
.this.async
has a default value ofundefined
,true
when forwarded (previouslyfalse
).