Angular2 : X-XSRF-TOKEN is not allowed by Access-Control-Allow-Headers Angular2 : X-XSRF-TOKEN is not allowed by Access-Control-Allow-Headers heroku heroku

Angular2 : X-XSRF-TOKEN is not allowed by Access-Control-Allow-Headers


Had the same issue.
In my case the reason was that in my Chrome cookies was saved X-XSRF-TOKEN field. And somehow Chrome added header 'Access-Control-Request-Headers: x-xsrf-token' to OPTION request. In Firefox the same page works fine, in incognito mode Chrome - too.
So I've just delete this cookies field (X-XSRF-TOKEN) and that's all.


In my case I had to add the 'x-xsrf-token' value to 'Access-Control-Allow-Headers' header:

header('Access-Control-Allow-Headers: Content-Type, x-xsrf-token')

see AngularJS: POST Data to External REST API


I cleared cookies, this solved problem.