Michael Solomon

Results 282 comments of Michael Solomon

@kettanaito isn't this Node only interceptor?

I think I found a small edge case on empty streams: ```js const got = require('got') const { ClientRequestInterceptor } = require('@mswjs/interceptors/ClientRequest') const interceptor = new ClientRequestInterceptor() interceptor.on('request', function rootListener({...

HEAD requests with response body: ```js const got = require('got') const { ClientRequestInterceptor } = require('@mswjs/interceptors/ClientRequest') const interceptor = new ClientRequestInterceptor() interceptor.on('request', function rootListener({ request }) { request.respondWith(new Response('hello')) })...

It seems like there is no authorized property in the https socket. ![image](https://github.com/mswjs/interceptors/assets/11459632/4358b612-d35d-4148-8dfb-a64d28be3087) ![image](https://github.com/mswjs/interceptors/assets/11459632/0c749c2e-aacc-48d2-8e6e-a004d1d8d6f2)

```js const http = require('http') const { ClientRequestInterceptor } = require('@mswjs/interceptors/ClientRequest') const { Stream } = require('stream') const interceptor = new ClientRequestInterceptor() const a = new Stream.PassThrough() interceptor.on('request', function rootListener({...

You are correct. I always forget this null thing!

It seems like `write` callback never get called. I guess we don't emit the required event in the socket. ```js const got = require('got') const http = require('http') const {...

I think we need to add the chunk size on write when transfer encoding is chunked. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding I think can open a PR to fix this.

It seems like we don't propogate mocked response error to the client: ```js it.only('error', async () => { interceptor.removeAllListeners() interceptor.on('request', ({ request }) => { const replyBody = new PassThrough()...

After I thought about it, I think we should add an extra argument or a way to pass the raw headers more straightforwardly. I think that the `rawHeaders` case is...