Skip to main content

What is CORS?

Learn What is CORS? (CORS, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes CORS (Cross-Origin Resource Sharing) is a browser mechanism where a server uses HTTP headers to say which other origins may read its responses. Purpose : browsers block JavaScript on http://localhost:3000 from reading a response from http://localhost:8080 unless the server allows it. Server side : Spring adds headers such as Access-Control-Allow-Origin ; the browser, not the server, enforces the rule.

More lessons in CORS