How can I identify a CORS preflight request?

后端 未结 2 1628
慢半拍i
慢半拍i 2021-01-21 13:51

A CORS preflight request obviously uses the OPTIONS method and has an Origin header. However, a browser can decide for any HTTP request to add an Origin header. Also, O

2条回答
  •  长发绾君心
    2021-01-21 14:26

    Check for the Access-Control-Request-Method header. It would not make much sense to send it in a request other than the preflight request.

提交回复
热议问题