Step 220–25 minutes

Cross-Origin Resource Sharing (CORS)

CORS is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served.

VISUALIZATION: CORS PREFLIGHT
Server Config:
Browser (Origin A)
Server (Origin B)
Browser is about to send a complex request (e.g., DELETE or Custom Headers).

Mastery Goals

Predict browser behavior for cross-origin requests

  • same-origin vs cross-origin
  • preflight requests
  • CORS headers

Ready to move on?

Mark this section as complete to track your progress through the curriculum.

Next Topic