[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 = {};
|
const listeners = {};
|
||||||
|
|
||||||
nodeReq(options).then(async (res) => { // No error handling because yes
|
nodeReq(options).then(async (res) => { // No error handling because yes
|
||||||
const isError = !res.agent;
|
const isError = !res.statusCode;
|
||||||
|
|
||||||
if (isError) {
|
if (isError) {
|
||||||
listeners['error']?.(res);
|
listeners['error']?.(res);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue