suhaotian / xior

A lite request lib based on fetch with plugin support and similar API to axios.
https://suhaotian.github.io/xior/
MIT License
193 stars 4 forks source link

withCredentials is not working #19

Closed guoyunhe closed 5 months ago

guoyunhe commented 5 months 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 5 months ago

Thanks feedback, fix in v0.5.1.

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

guoyunhe commented 5 months ago

Awesome!