Enable CORS requests to pass necessary headers.

To fully enable session deletion over CORS we need support for passing the
`X-Requested-With` header so that these requests can pass the `check-xhr` filter.

I also allowed the `X-CSRF-Token` to enable the alternative CSRF passing syntax.
This commit is contained in:
Aaron Boushley 2015-05-14 09:46:36 -07:00
parent 635b31af7b
commit 60aa52b753

View file

@ -29,7 +29,8 @@ if GlobalSetting.enable_cors
end end
headers['Access-Control-Allow-Origin'] = origin || cors_origins[0] headers['Access-Control-Allow-Origin'] = origin || cors_origins[0]
headers['Access-Control-Allow-Credentials'] = "true" headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-CSRF-Token'
headers['Access-Control-Allow-Credentials'] = 'true'
end end
headers headers