Angular 6 does not add X-XSRF-TOKEN header to http request

前端 未结 7 2106
忘了有多久
忘了有多久 2020-12-02 21:06

I\'ve read the docs and all the related questions on SO, but still Angular\'s XSRF mechanism isn\'t working for me: in no way I can make a POST request with the X-XSRF-TOKEN

7条回答
  •  没有蜡笔的小新
    2020-12-02 21:28

    Make sure, your server allows X-CSRF-Token headers on when browser requests OPTIONS method.

    Example:

    Access-Control-Allow-Headers: X-CSRF-Token, Content-Type
    

    Reference: MDN Docs

提交回复
热议问题