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
RequestError: unexpected end of file #1826
Comments
Please post the full stack trace. |
Thanks @szmarczak, here is the full stack:
|
Duplicate of #224 but this shouldn't happen. |
Can you provide a fully working code to reproduce? |
Sure, @szmarczak here you go: const tunnel = require("tunnel");
async function work() {
console.log("testing");
let options = {
url: <ANY_LINK>,
return_full_response: true,
resolve_with_full_response: true,
timeout: 120000,
retries: 1,
responseType: "text",
throwHttpErrors: false,
agent: {
https: tunnel.httpsOverHttp({
rejectUnauthorized: false,
proxy: {
host: <PROXY_IP>,
port: <PROXY_PORT>
}
})
}
};
for (let attempt_number = 0; attempt_number < 100; attempt_number++) {
console.log(`Fetching attempt number ${attempt_number}.`);
const res = await got(options);
console.log(res.statusCode);
}
}
work(); |
I ran locally (with a proxy) and no bugs on main branchimport got from './dist/source/index.js';
import tunnel from 'tunnel';
async function work() {
console.log("testing");
let options = {
url: 'https://httpbin.org/anything',
// return_full_response: true,
// resolve_with_full_response: true,
timeout: 120000,
retry: {limit: 1},
responseType: "text",
throwHttpErrors: false,
agent: {
https: tunnel.httpsOverHttp({
rejectUnauthorized: false,
proxy: {
host: '127.0.0.1',
port: 8001,
proxyAuth: 'username:password'
}
})
}
};
for (let attempt_number = 0; attempt_number < 100; attempt_number++) {
console.log(`Fetching attempt number ${attempt_number}.`);
const res = await got(options);
console.log(res.statusCode);
}
}
work();
|
I tested again with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Actual behavior
When I execute number of requests one after the other, after X request (the number is changes after each running) I get the following error from got:
RequestError: unexpected end of file at PassThrough.eval (webpack://justeat/./node_modules/got/dist/source/core/index.js?:800:31)
The status code is 200 and the status is OK.
...
Expected behavior
To parse the response successfully.
...
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: