sindresorhus / ky

🌳 Tiny & elegant JavaScript HTTP client based on the Fetch API
MIT License
13.61k stars 364 forks source link

fix: support cloudflare workers #559

Closed riderx closed 7 months ago

riderx commented 7 months ago

This PR comes to fix the Cloudflare workers issue mentioned here with the solution: https://github.com/sindresorhus/ky/issues/366#issuecomment-1670435774

Fixes #366

sindresorhus commented 7 months ago

CI is failing

riderx commented 7 months ago

@sindresorhus fixed :)

riderx commented 7 months ago

Thanks @fregante i did update it. I had to change the typing to make this solution work, and added a comment. I did try and {credentials: undefined} is the required way for Cloudflare. Since isCredentialsSupported is not reused, I wonder if that shouldn't be better, directly in the ternary?