Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1128889 of Origin

  • Revision slug: Web/HTTP/Headers/Origin
  • Revision title: Origin
  • Revision id: 1128889
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment

Revision Content

{{HTTPSidebar}}

The Origin request header specifies indicates where a fetch originates from. It doesn't include any path information, but only the server name. It is sent in requests where a {{Glossary("CORS")}} flag is set as well as in {{HTTPMethod("POST")}} requests.

Header type {{Glossary("Request header")}}
{{Glossary("Forbidden header name")}} yes

Syntax

Origin: ""
Origin: <scheme> "://" <host> [ ":" <port> ]

Origin can be the empty string; this is useful, for example, if the source is a data URL.

Directives

<scheme>
The protocol that is used. Usually it is the HTTP protocol or its secured version, HTTPS.
<host>
The domain name of the server (for virtual hosting) or the IP.
<port> {{optional_inline}}
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", "Origin", "7")}} The Web Origin Concept
{{SpecName('Fetch','#origin-header','Origin header')}} Supplants the Origin header as defined in RFC6454.

Browser compatibility

{{Compat}}

See also

Revision Source

<div>{{HTTPSidebar}}</div>

<p>The <strong><code>Origin</code></strong> request header specifies indicates where a fetch originates from. It doesn't include any path information, but only the server name. It is sent in requests where a {{Glossary("CORS")}} flag is set as well as in {{HTTPMethod("POST")}} requests.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header type</th>
   <td>{{Glossary("Request header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>yes</td>
  </tr>
 </tbody>
</table>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">
Origin: ""
Origin: &lt;scheme&gt; "://" &lt;host&gt; [ ":" &lt;port&gt; ]
</pre>

<p><code>Origin</code> can be the empty string; this is useful, for example, if the source is a <code>data</code> URL.</p>

<h2 id="Directives">Directives</h2>

<dl>
 <dt>&lt;scheme&gt;</dt>
 <dd>The protocol that is used. Usually it is the HTTP protocol or its secured version, HTTPS.</dd>
 <dt>&lt;host&gt;</dt>
 <dd>The domain name of the server (for virtual hosting) or the IP.</dd>
 <dt>&lt;port&gt; {{optional_inline}}</dt>
 <dd>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.</dd>
</dl>

<h2 id="Examples">Examples</h2>

<pre>
Origin: https://developer.mozilla.org</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{RFC("6454", "Origin", "7")}}</td>
   <td>The Web Origin Concept</td>
  </tr>
  <tr>
   <td>{{SpecName('Fetch','#origin-header','Origin header')}}</td>
   <td>Supplants the <code>Origin</code> header as defined in RFC6454.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>

<p>{{Compat}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{HTTPHeader("Host")}}</li>
 <li>{{HTTPHeader("Referer")}}</li>
 <li><a href="/en-US/docs/Web/Security/Same-origin_policy">Same-origin policy</a></li>
</ul>
Revert to this revision