I can see this being one of two problems:
You're accessing the page that makes the CORS request over the
file://
protocol instead ofhttp://
. This causes you to have anorigin
of'null'
. Try using accessing it viahttp://
instead (e.g.python -m SimpleHTTPServer
).Does your endpoint require cookie-base authentication? jQuery omits cookies on CORS requests by default. If you need to send cookies with your request, add
{xhrFields: withCredentials: true}
to your ajax requests (docs).