-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
request dont decompress response body #2260
Comments
That’s because there’s no hard need for This is not a bug in Undici but rather an expected outcome. Decompress is up to the responde handler and not to the client itself per se |
Maybe you need to add some parameter to unpack body ? |
I'm not 100% convinced but not against it. I have the feeling that it can cause several regressions, as well as hide possible optimizations that can be made on the implementer's side. Like custom backpressure and whatnot. @ronag @mcollina @KhafraDev any thoughts? I think Khafra is already +1 😄 ? |
I'm -1 in adding it to request, it would slow us down even if it's not enabled. I'm ok to add it under an option, if you really think it's necessary. |
I think we need to add the decompress: boolean parameter in requestOptions |
Hello ! Maybe something automatic, like if the response contains gzip encoding header we should decompress it ? |
I'm more into the possibility of creating a |
I think that if we are going to recommend request over fetch, it should be just as easy to use. I'm fine with it not being enabled by default, but it wouldn't be that hard to reuse the logic from fetch. |
I'm fine with an option. An alternative is to add it through a handler, similar to what https://github.com/nxtedition/nxt-undici does. Not sure if I like our current "interceptor" pattern but it could go through something like that. |
I'm +1 to an option or a documentated interceptor. |
Marking as |
I Don't know how "good first issue" this is, but here are the files redirect interceptor follows... https://github.com/nodejs/undici/blob/6a04edcd5867c4de6bd53d10f6b44eaecf02755e/lib/interceptor/redirectInterceptor.js It might also help (although the redirect interceptor doesn't seem to have); to provide unit tests for the various parts prior to connecting through the whole of undici. |
See #951 as well RE: last comment. |
See |
Lines 2171 to 2210 in 6a04edc
|
Bug Description
Why doesn't request support response body decompression?
Logs & Screenshots
using fetch

using request

Environment
undici@5.24.0
The text was updated successfully, but these errors were encountered: