-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-sdk (v2 and v3) response not being decompressed when response is gzip #5266
Comments
@lightpriest I am having this issue as well with
|
@lightpriest Do you mean to say |
Not sure if this is related, but if |
It looks like PR 4399 was merged but it looks like the MacOS tests were still failing. |
@iidebyo Ah, this is great. Your fix tells the client to stop adding the extraneous |
This would be a deal-breaker for me to use bun in production as AWS-SDK is very required in my business logic. |
I can confirm its working in the latest main branch ( There's a different issue, though. When I print the response of the |
It doesn't work on my end with aws-sdk-v3, same revision as yours
Error:
Here's code to reproduce:
fwiw, I noticed that after |
I think it'd be in a new version. I don't see #5057 in v1.0.1 commits. |
I see, this issue was coming from the day 1. I'm glad it has been fixed in the latest release. |
What version of Bun is running?
1.0.1-debug+c9c62f37e5bd6362220fb0a39ad20cffd73e486e
What platform is your computer?
Darwin 22.6.0 arm64 arm
What steps can reproduce the bug?
A simple request to AWS SSM using the aws-sdk fails with some cryptic message. The same happens for aws-sdk@3.
The following code generates the issue:
What is the expected behavior?
What do you see instead?
Additional information
Regarding bun version, it happened to me in bun 1.0.1 as well. I just tried to build the main branch to see if it might have been fixed by now.
I investigated it a bit further and just placed console.log in some specific places. When I just printed the body of the response, it looked like binary data, so I figured it was a compressed response not being deflated.
In the file
.../node_modules/aws-sdk/lib/protocol/json.js
, inextractData
function I modified it to look like this:This validated what I suspected, the output now looks like this:
Going a little bit further, I looked at
src/bun.js/webcore/response.zig
Bun__fetch
. I placed a log wheredisable_decompression
is assigned, and saw that it was set to false for some reason.This is as far as I got into it, I haven't gotten into the project's internals to understand where these options are being set (is this a JSC implementation underneath?). And I also think it might be specific to my setup, but I'm not sure what. I'm also surprised it's not reported, since it's a pretty common use-case. Anyway, it should probably work regardless (to be node-compatible).
The text was updated successfully, but these errors were encountered: