However there is currently no way to append the `preload` directive to
that header, which is required to indicate that the site owner consents to
the HSTS header being added to browser's pre-loaded list of sites that
should only be accessed over HTTPS:
https://hstspreload.appspot.com/
https://developer.mozilla.org/en-
US/docs/Web/Security/HTTP_strict_transport_security#Preloading_Strict_Transport_Security
https://www.owasp.org/index.php/HTTP_Strict_Transport_Security_Cheat_Sheet#Examples
I propose the addition of a new preference named `SECURE_HSTS_PRELOAD`
that enables the directive, and behaves in a similar manner to defining
`SECURE_HSTS_INCLUDE_SUBDOMAINS`.
I'll open a PR shortly :-)
--
Ticket URL: <https://code.djangoproject.com/ticket/26947>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/26947#comment:1>
* status: new => assigned
* has_patch: 0 => 1
Comment:
PR opened. I've also submitted a CLA.
--
Ticket URL: <https://code.djangoproject.com/ticket/26947#comment:2>
Comment (by Tim Graham <timograham@…>):
In [changeset:"7399fee6c3bb7eded1ecf5855d71520db299d79d" 7399fee6]:
{{{
#!CommitTicketReference repository=""
revision="7399fee6c3bb7eded1ecf5855d71520db299d79d"
Refs #26947 -- Added a deployment system check for SECURE_HSTS_PRELOAD.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26947#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"3c2447dd13e495d57700ca8447896acd85044444" 3c2447dd]:
{{{
#!CommitTicketReference repository=""
revision="3c2447dd13e495d57700ca8447896acd85044444"
Fixed #26947 -- Added an option to enable the HSTS header preload
directive.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26947#comment:3>