lquixada / cross-fetch

Universal WHATWG Fetch API for Node, Browsers and React Native.
MIT License
1.66k stars 102 forks source link

Add support for agent property from node-fetch #176

Open RikudouSage opened 9 months ago

RikudouSage commented 9 months ago

I'd like to ignore https errors for one specific endpoint using node.js.

In node-fetch this can be done using the agent property, the problem is that it's not exposed in typescript so the code doesn't transpile. Currently I've "solved" it by retyping it as any which is far from ideal.

Adding support for the agent property would be great.

lewisjr commented 7 months ago

I agree. I instead used ts-ignore like:

const req = await fetch(..., {
   ...
   // @ts-ignore
   agent: ...
});

cross-fetch version: 4.0.0