Remove misleading Content-Length. master 0.2.7
authorRadek Czajka <rczajka@rczajka.pl>
Fri, 15 Mar 2019 13:41:33 +0000 (14:41 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Fri, 15 Mar 2019 13:41:33 +0000 (14:41 +0100)
CHANGELOG.md
ssify/middleware.py
ssify/version.py

index 290fd36..8e05415 100644 (file)
@@ -1,5 +1,9 @@
 # Changelog
 
 # 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.
 ## 0.2.6 (2019-02-13)
 
 * Django 1.9-1.11 compatibility.
index 419a074..8e0f453 100644 (file)
@@ -118,6 +118,8 @@ class SsiMiddleware(object):
         request.ssi_vars_needed = {}
 
     def _process_rendered_response(self, request, response):
         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
         # Prepend the SSI variables.
         if hasattr(request, 'ssi_vars_needed'):
             vars_needed = request.ssi_vars_needed
index 2147ed9..9873fd0 100644 (file)
@@ -1,3 +1,3 @@
 from __future__ import unicode_literals
 
 from __future__ import unicode_literals
 
-VERSION = '0.2.6'
+VERSION = '0.2.7'