CORS preflight request fails due to a standard header

前端 未结 7 1164
灰色年华
灰色年华 2020-12-23 17:04

While debugging a CORS issue I am experiencing I\'ve found the following behaviour. Chrome makes the following OPTIONS preflight request (rewritten in CURL by Chrome itself)

7条回答
  •  醉话见心
    2020-12-23 17:51

    I added this as an answer because I couldn't format it well for the top voted answer.

    I found this post helpful as well: How to handle HTTP OPTIONS with Spring MVC?

    DispatchServlet must be configured to pass along options request, or else it never reaches the mapped request:

    ...
      
        yourServlet
        org.springframework.web.servlet.DispatcherServlet
        
          dispatchOptionsRequest
          true
        
        1
      
    ...
    

提交回复
热议问题