bent
bent copied to clipboard
Support for credentials mode
https://github.com/mikeal/bent/issues/88
We need to support this in Node.js as well.
Actually, I take that back, there’s isn’t much to do in Node.js.
I’d like to avoid an API here that has to touch core.js. It shouldn’t even need to extend the arguments if we do it right. How about something more like
const get = bent()
get.credentials = ‘include’
I understand your intention to keep core.js clean by only putting code there which is relevant to node and browser. On the other side, your proposal makes the client api more verbose and kinda kills bent's beauty of param type inspection for the browser. Probably, there is some trade-off solution in between, but I currently can't come up with one.
Just out of interest, any movement on the PR? I'm interested in using these changes but just wondering if I should implement them manually in my own repo rather than wait on this.
Actually, I take that back, there’s isn’t much to do in Node.js.
I’d like to avoid an API here that has to touch
core.js. It shouldn’t even need to extend the arguments if we do it right. How about something more likeconst get = bent() get.credentials = ‘include’
This get.credentials = 'include' workaround will not work, when use with another lib/framework which wrap window.fetch in the first place, like SvelteKit did.