Revision 1143083 of Upgrade-Insecure-Requests

  • Revision slug: Web/HTTP/Headers/Upgrade-Insecure-Requests
  • Revision title: Upgrade-Insecure-Requests
  • Revision id: 1143083
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{HTTPSidebar}}

The HTTP Upgrade-Insecure-Requests request header sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the {{CSP("upgrade-insecure-requests")}} CSP directive.

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

Syntax

Upgrade-Insecure-Requests: 1

Examples

A client requests  signals to the server that it supports the upgrade mechanisms of {{CSP("upgrade-insecure-requests")}}:

GET / HTTP/1.1 
Host: example.com 
Upgrade-Insecure-Requests: 1

The server can now redirect to a secure version of the site. A {{HTTPHeader("Vary")}} header can be used so that the site isn't served by caches to clients that don’t support the upgrade mechanism.

Location: https://example.com/ 
Vary: Upgrade-Insecure-Requests

Specifications

Specification Status Comment
{{specName("Upgrade Insecure Requests", "#preference", "upgrade-insecure-requests")}} {{Spec2('Upgrade Insecure Requests')}} Initial definition.

Browser compatibility

{{Compat}}

See also

  • {{HTTPHeader("Content-Security-Policy")}}
  • CSP {{CSP("upgrade-insecure-requests")}} directive

Revision Source

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

<p>The HTTP <strong><code>Upgrade-Insecure-Requests</code></strong> request header sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the {{CSP("upgrade-insecure-requests")}} <a href="/en-US/docs/Web/Security/CSP">CSP</a> directive.</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>no</td>
  </tr>
 </tbody>
</table>

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

<pre class="syntaxbox">
Upgrade-Insecure-Requests: 1</pre>

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

<p>A client requests&nbsp; signals to the server that it supports the upgrade mechanisms of {{CSP("upgrade-insecure-requests")}}:</p>

<pre>
GET / HTTP/1.1 
Host: example.com 
Upgrade-Insecure-Requests: 1</pre>

<p>The server can now redirect to a secure version of the site. A {{HTTPHeader("Vary")}} header can be used so that the site isn't served by caches to clients that don’t support the upgrade mechanism.</p>

<pre>
Location: https://example.com/ 
Vary: Upgrade-Insecure-Requests</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("Upgrade Insecure Requests", "#preference", "upgrade-insecure-requests")}}</td>
   <td>{{Spec2('Upgrade Insecure Requests')}}</td>
   <td>Initial definition.</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("Content-Security-Policy")}}</li>
 <li>CSP {{CSP("upgrade-insecure-requests")}} directive</li>
</ul>
Revert to this revision