I noticed a strange caution message when looking at downloaded resources using Google chrome inspector (F12):
Caution provisional headers a
My situation is cross-origin related.
Situation: Browser sends OPTIONS
request before sending the real request like GET
or POST
. Backend developer forgets to deal with the OPTIONS
request, letting it go through the service code, making the processing time too long. Longer than the timeout setting I wrote in the axios
initialization, which is 5000 milliseconds. Therefore, the real request couldn't be sent, and then I encountered the provisional headers are shown
problem.
Solution: When it comes to OPTIONS
request, backend api just return result, it makes the request faster and the real request can be sent before timeout.