-
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
"Accept-Encoding" inserted into http requests headers #5043
Comments
The behavior you are observing is related to how the In your code, you are making an HTTP request to When you use As a result, when you call To handle compressed responses from an HTTP request in a more appropriate manner, you should use asynchronous decompression and handle the response incrementally. You can use the import http from 'node:http';
import zlib from 'node:zlib';
const req = http.get('http://example.com/', (res) => {
const gunzip = zlib.createGunzip();
res.pipe(gunzip);
let data = '';
gunzip.on('data', (chunk) => {
data += chunk;
});
gunzip.on('end', () => {
console.log(data);
console.log(data.length);
});
});
req.end(); In this example, we create a |
Please take another look at expected and observed behavior. |
fixed by #5057 |
What version of Bun is running?
1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983
What platform is your computer?
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
What is the expected behavior?
An error should appear such as:
Error: incorrect header check
.What do you see instead?
html from http://example.com
Additional information
bun/src/http_client_async.zig
Lines 2125 to 2128 in 8615b8a
The text was updated successfully, but these errors were encountered: