bent icon indicating copy to clipboard operation
bent copied to clipboard

Support for credentials mode

Open johakr opened this issue 5 years ago • 5 comments
trafficstars

https://github.com/mikeal/bent/issues/88

johakr avatar Apr 02 '20 08:04 johakr

We need to support this in Node.js as well.

mikeal avatar Apr 13 '20 21:04 mikeal

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’

mikeal avatar Apr 13 '20 21:04 mikeal

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.

johakr avatar Apr 14 '20 21:04 johakr

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.

timesync avatar May 28 '20 18:05 timesync

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’

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.

biaocy avatar Jun 16 '22 14:06 biaocy