[Polyfill > Request] Fix false erroring with valid responses
This commit is contained in:
parent
0c7705f36a
commit
0b532c8d6e
1 changed files with 1 additions and 1 deletions
|
@ -51,7 +51,7 @@ const request = (options, callback) => { // Main function
|
|||
const listeners = {};
|
||||
|
||||
nodeReq(options).then(async (res) => { // No error handling because yes
|
||||
const isError = !res.agent;
|
||||
const isError = !res.statusCode;
|
||||
|
||||
if (isError) {
|
||||
listeners['error']?.(res);
|
||||
|
|
Loading…
Reference in a new issue