suhaotian / xior

A lite request lib based on fetch with plugin support and similar API to axios.
https://www.npmjs.com/package/xior
MIT License
114 stars 1 forks source link

withCredentials is not working #19

Closed guoyunhe closed 1 month ago

guoyunhe commented 1 month ago

withCredentials is xhr option, so axios has:

axios.defaults.withCredentials = true;

However, xior uses fetch, fetch has different option credentials for the same functionality:

xior.defaults.credentials = 'include';

This makes xior ignoring withCredentials.

suhaotian commented 1 month ago

Thanks feedback, fix in v0.5.1.

Now if xior.defaults.withCredentials = true;, xior will set credentials='include'

guoyunhe commented 1 month ago

Awesome!