diff options
| author | Artur Juraszek <artur@juraszek.xyz> | 2018-10-29 23:19:04 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-10-30 18:30:51 -0400 |
| commit | 817c6cdf0e2a72362045ca503af01830df9b9d36 (patch) | |
| tree | 9c9a9efd190546275b0ecb36178cf2fbc00d83c1 /django/middleware/security.py | |
| parent | c1c68d1ac0f0d50eb37df32892b132f31a1179da (diff) | |
Capitalized SecurityMiddleware headers for consistency with other headers.
(No behavior change since HTTP headers are case insensitive.)
Diffstat (limited to 'django/middleware/security.py')
| -rw-r--r-- | django/middleware/security.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/middleware/security.py b/django/middleware/security.py index 296567432f..dfca3b64de 100644 --- a/django/middleware/security.py +++ b/django/middleware/security.py @@ -29,18 +29,18 @@ class SecurityMiddleware(MiddlewareMixin): def process_response(self, request, response): if (self.sts_seconds and request.is_secure() and - 'strict-transport-security' not in response): + 'Strict-Transport-Security' not in response): sts_header = "max-age=%s" % self.sts_seconds if self.sts_include_subdomains: sts_header = sts_header + "; includeSubDomains" if self.sts_preload: sts_header = sts_header + "; preload" - response["strict-transport-security"] = sts_header + response['Strict-Transport-Security'] = sts_header if self.content_type_nosniff: - response.setdefault('x-content-type-options', 'nosniff') + response.setdefault('X-Content-Type-Options', 'nosniff') if self.xss_filter: - response.setdefault('x-xss-protection', '1; mode=block') + response.setdefault('X-XSS-Protection', '1; mode=block') return response |
