Browser & Web Performance · Senior · Question 41 of 75

Does a correct CORS configuration protect an API from CSRF?

Explanation

Only non-simple requests are blocked by a failing preflight. Requiring a JSON content type or a custom header helps, plus SameSite and tokens.

Further reading

Problem with a question

Browser & Web Performance · Senior · question 41

Test yourself

Take the Browser & Web Performance · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz