W3cubDocs

/HTTP

Origin

The Origin request header indicates where a fetch originates from. It doesn't include any path information, but only the server name. It is sent with CORS requests, as well as with POST requests. It is similar to the Referer header, but, unlike this header, it doesn't disclose the whole path.

Note: The Origin header is not set on Fetch requests with a method of HEAD or GET (this behavior was corrected in Firefox 65 — see bug 1508661).

Syntax

Origin: null
Origin: <scheme> "://" <hostname> [ ":" <port> ]

Directives

<scheme>
The protocol that is used. Usually it is the HTTP protocol or its secured version, HTTPS.
<hostname>
The domain name of the server (for virtual hosting) or the IP.
<port> Optional
TCP port number on which the server is listening. If no port is given, the default port for the service requested (e.g., "80" for an HTTP URL) is implied.

Examples

Origin: https://developer.mozilla.org

Specifications

Specification Comment
RFC 6454, section 7: Origin The Web Origin Concept
Fetch
The definition of 'Origin header' in that specification.
Supplants the Origin header as defined in RFC6454.

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Origin Yes 12
12
Not sent with POST requests, see bug 10482384.
70
70
59
Disabled
Sent with non-CORS requests since Fx59, unless they are GET or HEAD.
Disabled From version 59: this feature is behind the network.http.sendOriginHeader preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Partial
Not sent with POST requests until Firefox 58, see bug 446344.
Yes Yes Yes
Mobile
Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
Origin Yes Yes 59
Disabled
59
Disabled
Sent with non-CORS requests since Fx59, unless they are GET or HEAD.
Disabled From version 59: this feature is behind the network.http.sendOriginHeader preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Partial
Not sent with POST requests until Firefox 58, see bug 446344.
Yes Yes Yes

See also

© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin