Permalink
Browse files

Adjusted Content-Length if we modify the response.

  • Loading branch information...
robhudson committed Feb 26, 2010
1 parent 02cecd7 commit ebdcdc60509663b3515f61fe990491e6cfefa398
Showing with 2 additions and 0 deletions.
  1. +2 −0 debug_toolbar/middleware.py
@@ -100,5 +100,7 @@ def process_response(self, request, response):
smart_unicode(response.content),
self.tag,
smart_unicode(self.debug_toolbars[request].render_toolbar() + self.tag))
+ if response.get('Content-Length', None):
+ response['Content-Length'] = len(response.content)
del self.debug_toolbars[request]
return response

0 comments on commit ebdcdc6

Please sign in to comment.