From bc43e9922ca91c95797311937e7b5c0134211db5 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 15 Mar 2019 14:41:33 +0100 Subject: [PATCH] Remove misleading Content-Length. --- CHANGELOG.md | 4 ++++ ssify/middleware.py | 2 ++ ssify/version.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 290fd36..8e05415 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.2.7 (2019-03-15) + +* Remove Content-Length response header added in Django 1.11. + ## 0.2.6 (2019-02-13) * Django 1.9-1.11 compatibility. diff --git a/ssify/middleware.py b/ssify/middleware.py index 419a074..8e0f453 100644 --- a/ssify/middleware.py +++ b/ssify/middleware.py @@ -118,6 +118,8 @@ class SsiMiddleware(object): request.ssi_vars_needed = {} def _process_rendered_response(self, request, response): + if 'Content-Length' in response: + del response['Content-Length'] # Prepend the SSI variables. if hasattr(request, 'ssi_vars_needed'): vars_needed = request.ssi_vars_needed diff --git a/ssify/version.py b/ssify/version.py index 2147ed9..9873fd0 100644 --- a/ssify/version.py +++ b/ssify/version.py @@ -1,3 +1,3 @@ from __future__ import unicode_literals -VERSION = '0.2.6' +VERSION = '0.2.7' -- 2.20.1