Web Security · Junior · Question 42 of 75
What is a CORS preflight request?
- 1A request that warms up the server cache before page load
- 2A DNS lookup done before every
fetch - ✓Correct answer: An
OPTIONSrequest the browser sends first to ask if a non-simple cross-origin request is allowed
Explanation
Requests with methods like PUT or headers like Content-Type: application/json trigger a preflight. If the server's answer doesn't allow it, the real request isn't sent.