upgrade-insecure-requests

Default Attribute

Ā 

Policy Description

The HTTP Content-Security-Policy (CSP) upgrade-insecure-requests directive instructs user agents to treat all of a siteā€™s insecure URLs (those served over HTTP) as though they have been replaced with secure URLs (those served over HTTPS). This directive is intended for web sites with large numbers of insecure legacy URLs that need to be rewritten. The upgrade-insecure-requests directive is evaluated beforeĀ block-all-mixed-contentĀ and if it is set, the latter is effectively a no-op. It is recommended to set either directive, but not both, unless you want to force HTTPS on older browsers that do not force it after a redirect to HTTP. The upgrade-insecure-requests directive will not ensure that users visiting your site via links on third-party sites will be upgraded to HTTPS for the top-level navigation and thus does not replace theĀ Strict-Transport-SecurityĀ (HSTS) header, which should still be set with an appropriate max-age to ensure that users are not subject to SSL stripping attacks.