janhommes / o.js

o.js - client side oData lib.
https://janhommes.github.io/o.js/example/
MIT License
241 stars 58 forks source link

Cookies are not send even is CORS is enabled #54

Closed jcchalte closed 7 years ago

jcchalte commented 7 years ago

When a CORS request is made, currently, no cookies are sent to the odata server, even if isCors is enabled.

There seems to be a missing line of code right before opening the XHR, the withCredential XHR field is not set, but it is mandatory to do CORS requests (at least into Chrome). I have made a simple pull request ( #53 ) to correct this but there are evidences in the code that the withCredential field has been taken into account (at least partially), so I don't know if I am not missing something by just setting it to true.

janhommes commented 7 years ago

PR accepted. Thanks for contributing. Will release a new version in a couple of days.