DELAPARRA
Index
Color
NL
Category: HTTP headers

Origin

Explained by Updated

What is Origin?

Origin: The scheme + host + port of the page making the request. Sent on cross-origin requests for CORS checks. The Origin header tells the server which site a request comes from: the scheme, host and port, such as https://app.example.com. Browsers add it automatically to cross-origin requests and to POST requests.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Origin

How is Origin used in practice?

Servers use it for CORS decisions, to decide whether to allow the browser to share the response with that site. It also helps against cross-site request forgery, because a request from another origin can be rejected outright.

What should you keep in mind with Origin?

Do not treat it as authentication. Scripts and tools outside a browser can send any Origin they like. Its value is in protecting users in real browsers. When you configure CORS, compare the header against an explicit list of trusted origins. Never reflect whatever origin was sent back into Access-Control-Allow-Origin without that check.

What does an example of Origin look like?

Origin: https://app.example.com

At a glance

CategoryHTTP headers
Explained by
Updated

More HTTP headers terms

All terms starting with O

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.