Normally both calls are shown, the pre-flight and the actual request. This is sometimes annoying. Is there a way to hide the pre-flights requests ?
Or is there a plugin to filter certain requests based on headers ?
Another way to avoid Preflight requests is to use simple requests. Preflight requests are not mandatory for simple requests, and according to w3c CORS specification, we can label HTTP requests as simple requests if they meet the following conditions. Request method should be GET , POST , or HEAD .
Unfortunately for you, there's no way to hide network requests from Chrome Network Log. Even if you could, it'd be still possible to use network analyzer tools such as Fiddler and Wireshark to log all the traffic between your computer and the Internet.
A CORS preflight request is a CORS request that checks to see if the CORS protocol is understood and a server is aware using specific methods and headers. It is an OPTIONS request, using three HTTP request headers: Access-Control-Request-Method , Access-Control-Request-Headers , and the Origin header.
The quickest way to do this is to filter on -method:OPTIONS
.
Explanation: all pre-flight requests are via the HTTP OPTIONS method (opposed to POST or GET). This filter says "not method OPTIONS".
Note the leading hyphen because if you forget it, you'll only show pre-flight requests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With