diff options
| author | Adam Malinowski <me@adammalinowski.co.uk> | 2016-11-05 12:39:46 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-11-05 22:24:54 +0100 |
| commit | 37809b891eae2e73c7e80fbf5d8b9a7e86e82b54 (patch) | |
| tree | c6d6f8713b130da71389d3bcb80889b4a20778b0 /django/middleware | |
| parent | c7dddc01d6ca8d8d89f84d26123ecb021aa2a108 (diff) | |
Fixed #27346 -- Stopped setting the Content-Length header in ConditionalGetMiddleware.
Diffstat (limited to 'django/middleware')
| -rw-r--r-- | django/middleware/http.py | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/django/middleware/http.py b/django/middleware/http.py index 41389d930e..173bb49f89 100644 --- a/django/middleware/http.py +++ b/django/middleware/http.py @@ -11,13 +11,8 @@ class ConditionalGetMiddleware(MiddlewareMixin): 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. - - Also sets the Content-Length response-header. """ def process_response(self, request, response): - if not response.streaming and not response.has_header('Content-Length'): - response['Content-Length'] = str(len(response.content)) - # It's too late to prevent an unsafe request with a 412 response, and # for a HEAD request, the response body is always empty so computing # an accurate ETag isn't possible. |
