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 1129281 of Access-Control-Allow-Headers

  • Revision slug: Web/HTTP/Headers/Access-Control-Allow-Headers
  • Revision title: Access-Control-Allow-Headers
  • Revision id: 1129281
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment new page

Revision Content

{{HTTPSidebar}}

The Access-Control-Allow-Headers response header is used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.

Required if the request has an {{HTTPHeader("Access-Control-Request-Headers")}} header.

Header type {{Glossary("Response header")}}
{{Glossary("Forbidden header name")}} no

Syntax

Access-Control-Allow-Headers: <header-name>, <header-name>, ...

Directives

<header-name>
Comma-delimited list of the supported request headers.

Examples

Access-Control-Allow-Headers: X-Custom-Header

Specifications

Specification Status Comment
{{SpecName('Fetch','#http-access-control-allow-headers', 'Access-Control-Allow-Headers')}} {{Spec2("Fetch")}}  

Browser compatibility

{{Compat}}

Compatibility notes

  • The wildcard value (*) that is mentioned in the latest specification, is not yet implemented in browsers:

See also

  • {{HTTPHeader("Access-Control-Allow-Origin")}}
  • {{HTTPHeader("Access-Control-Expose-Headers")}}
  • {{HTTPHeader("Access-Control-Allow-Methods")}}

Revision Source

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

<p>The <strong><code>Access-Control-Allow-Headers</code></strong> response header is used in response to a preflight request to indicate which HTTP&nbsp;headers can be used when making the actual request.</p>

<p>Required if the request has an {{HTTPHeader("Access-Control-Request-Headers")}} header.</p>

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

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

<pre class="syntaxbox">
Access-Control-Allow-Headers: &lt;header-name&gt;, &lt;header-name&gt;, ...
</pre>

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

<dl>
 <dt>&lt;header-name&gt;</dt>
 <dd>Comma-delimited list of the supported request headers.</dd>
</dl>

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

<pre>
Access-Control-Allow-Headers: X-Custom-Header</pre>

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

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Fetch','#http-access-control-allow-headers', 'Access-Control-Allow-Headers')}}</td>
   <td>{{Spec2("Fetch")}}</td>
   <td>&nbsp;</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="Compatibility_notes">Compatibility notes</h2>

<ul>
 <li>The wildcard value (*) that is mentioned in the latest specification, is not yet implemented in browsers:
  <ul>
   <li>Chromium: <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=615313">Issue 615313</a></li>
   <li>Firefox: {{bug(1309358)}}</li>
   <li>Servo: <a href="https://github.com/servo/servo/issues/13283">Issue 13283</a></li>
  </ul>
 </li>
</ul>

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

<ul>
 <li>{{HTTPHeader("Access-Control-Allow-Origin")}}</li>
 <li>{{HTTPHeader("Access-Control-Expose-Headers")}}</li>
 <li>{{HTTPHeader("Access-Control-Allow-Methods")}}</li>
</ul>
Revert to this revision