table of Contents
#accident scene
In the front end of a cross-domain request transmission time, transmits a first request options, so that the server know whether to allow the cross-domain request.
Cross-Origin Resource Sharing standard adds a set of HTTP header fields, which allows the server to declare the source station has permission to access what resources. Additionally, regulatory requirements, may produce adverse effects on those data to the server HTTP request method (in particular, other than the HTTP request GET, or with a certain MIME type POST request), the browser must first use the OPTIONS method to initiate a request for pre-screening ( preflight request), so that the server know whether to allow the cross-domain request. After the server acknowledges permission before initiating the actual HTTP request. In return preflight request, the server can inform the client, whether you need to carry identity documents (including Cookies and HTTP authentication-related data).
When the actual code debugging and found that the network is not visible chrome OPTIONS request, but with wireshark capture is possible to see the OPTIONS request, and checked under the chrome, there is no set Filter, This is strange! ! !
# Analysis and Solutions
- Analysis of
switching to another browser debugging, you can see the OPTIONS request, indicating that the set of issues chrome; - Solution
in the address bar chrome total inputchrome://flags/#out-of-blink-cors
to set it toDisabled
, and you can restart chrome;
#reference
- https://stackoverflow.com/questions/57410051/chrome-not-showing-options-requests-in-network-tab
- https://bugs.chromium.org/p/chromium/issues/detail?id=995740#c1
- https://support.google.com/chrome/thread/11089651?hl=en