janhommes / o.js

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

Added Access-Control headers if CORS is enabled #53

Closed jcchalte closed 6 years ago

jcchalte commented 6 years ago

First PR here, let's hope I do it well :)

Without setting withCredentials to true on javascript XHR, CORS is disabled. I added that in the relevant part of the code.

But there is something strange as

By reading the code, I suspect that maybe the developer knew but removed references to withCredential for a purpose. Maybe I am missing something here but the MDN article on withCredential does not indicate any side-effect.

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials

janhommes commented 6 years ago

Looks good for me -> merge. Don't remember why it was left out...