You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I apologize if this is a trivial question, but maybe some member of the community has run into a similar issue: I am using node-fetch with node v18.18.2 and am getting TypeErrors when a fetch-request is redirected.
In HTTP-redirect fetch step 9, the if-clause throws the error because it cannot access options_.body. This might be due to options being a Buffer. It looks like the function works just fine if I check for requestOptions.body instead.
// HTTP-redirect fetch step 9
if (response_.statusCode !== 303 && request.body && options_.body instanceof Stream.Readable) {
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
finalize();
return;
}
Is there some sort of oversight on my end here? I would appreciate any feedback.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I apologize if this is a trivial question, but maybe some member of the community has run into a similar issue: I am using node-fetch with node v18.18.2 and am getting TypeErrors when a fetch-request is redirected.
In HTTP-redirect fetch step 9, the if-clause throws the error because it cannot access options_.body. This might be due to options being a Buffer. It looks like the function works just fine if I check for requestOptions.body instead.
Is there some sort of oversight on my end here? I would appreciate any feedback.
Beta Was this translation helpful? Give feedback.
All reactions