diff options
| author | Anton Samarchyan <anton.samarchyan@savoirfairelinux.com> | 2017-01-24 15:37:33 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-04 10:02:06 -0500 |
| commit | 86de930f413e0ad902e11d78ac988e6743202ea6 (patch) | |
| tree | 790dcc4c38125b619ffee76b5531155d0d8232f4 /django/middleware/http.py | |
| parent | 6ae1b04fb584db0fdb22b8e287784c4ed3ac62ac (diff) | |
Refs #27656 -- Updated remaining docstring verbs according to PEP 257.
Diffstat (limited to 'django/middleware/http.py')
| -rw-r--r-- | django/middleware/http.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/django/middleware/http.py b/django/middleware/http.py index 173bb49f89..a739597f91 100644 --- a/django/middleware/http.py +++ b/django/middleware/http.py @@ -7,10 +7,9 @@ from django.utils.http import parse_http_date_safe class ConditionalGetMiddleware(MiddlewareMixin): """ - Handles conditional GET operations. If the response has an ETag or - Last-Modified header, and the request has If-None-Match or - If-Modified-Since, the response is replaced by an HttpNotModified. An ETag - header is added if needed. + Handle conditional GET operations. If the response has an ETag or + Last-Modified header and the request has If-None-Match or If-Modified-Since, + replace the response with HttpNotModified. Add an ETag header if needed. """ def process_response(self, request, response): # It's too late to prevent an unsafe request with a 412 response, and @@ -38,8 +37,6 @@ class ConditionalGetMiddleware(MiddlewareMixin): return response def needs_etag(self, response): - """ - Return True if an ETag header should be added to response. - """ + """Return True if an ETag header should be added to response.""" cache_control_headers = cc_delim_re.split(response.get('Cache-Control', '')) return all(header.lower() != 'no-store' for header in cache_control_headers) |
