interceptors icon indicating copy to clipboard operation
interceptors copied to clipboard

Low-level network interception library.

Results 104 interceptors issues
Sort by recently updated
recently updated
newest added

I was using Remix and had tried to do the following in my server.js file (I'm using Remix express template) ```ts interceptor.on('request', async (request) => { if(request.method === "POST"){ const...

**In this PR** This PR migrates the development environment to Node v18 (which [replaces v16 as active LTS in October](https://nodejs.org/en/about/releases/)), and adds tests in CI for v14, v16 and v18....

### Description This PR adds a `SendBeaconInterceptor` for intercepting `navigator.sendBeacon()` calls. ### Important Details #### Response data does not matter `sendBeacon` is a fire-and-forget call. It is a synchronous function...

Yet another attempt at the Socket-based interceptor. This time, we are tapping into the `HTTPParser` from Node.js to give us the HTTP message parsing. - Makes it possible to implement...

Hello, Can a timeout be added to the requests on the interceptor? The goal is to add a timeout for any intercepted request and modify the request.

enhancement
DX

Hi! Thanks for your work. I appreciate the recent addition of the X-Request-Id header for each request. However, it seems to be causing a header CORS issue when the server...

help wanted
needs:discussion

https://github.com/mswjs/interceptors/blob/ac4f22b1319401d946746d5ca34f6f98846465f1/src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts#L610 if `location.href` is an empty string, you get an "Invalid baseURL" error. ![image](https://github.com/mswjs/interceptors/assets/6201030/c074886c-8763-4680-9cb8-c24c4ce74bcf) I believe this could easily be fixed by updating to `return new URL(url.toString(), location.href || undefined)`

It's time we've added automation around Node.js v20. ## Roadmap - [ ] Update to the latest `pnpm`. Looks like v7 cannot run in Node.js 20 properly (see failed job).

## Motivation When working with MSW, users experience an issue that requests may continue pending even after the tests are done. The issue itself is often caused by the user's...

Hi, thanks for this great library! We had a question about the behavior for intercepted requests. We noticed that the header keys are being converted to lowercase, but we didn't...