ghcjs / ghcjs-base

base library for GHCJS for JavaScript interaction and marshalling, used by higher level libraries like JSC
MIT License
45 stars 67 forks source link

Respect `.withCredentials`property of XHR #57

Closed EugeneN closed 8 years ago

EugeneN commented 8 years ago

reqWithCredentials field is present in the Request type, but it is not used for actual XHR requests. This way one can not make CORS requests with credentials, which results is a loss of interesting functionality for rich web applications which work with APIs from other origins.

This pull request makes xhr function respect reqWithCredentials parameter.

And also provides a little bit less mysterious error message on XHR errors ("some error" is very abstract :-)

bergey commented 8 years ago

Thank you!