Skip to content

Commit ebdcdc6

Browse files
committed
Adjusted Content-Length if we modify the response.
1 parent 02cecd7 commit ebdcdc6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

debug_toolbar/middleware.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,7 @@ def process_response(self, request, response):
100100
smart_unicode(response.content),
101101
self.tag,
102102
smart_unicode(self.debug_toolbars[request].render_toolbar() + self.tag))
103+
if response.get('Content-Length', None):
104+
response['Content-Length'] = len(response.content)
103105
del self.debug_toolbars[request]
104106
return response

0 commit comments

Comments
 (0)