Django

Code

Ticket #3052 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

gzip middleware bug

Reported by: simonbun <simonbun@versea.be> Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

The current gzip middleware forgets to update the response's Content-Length and so the uncompressed size is wrongly returned.

This caused my apache connection to remain open after the last files had transfered, untill it timed out. Standard setting for this timeout is 15 seconds, so it can be quite annoying. The page appears to keep on loading, even though all content has loaded correctly.

Here is the small patch:

--- gzip.py	(revision 4088)
+++ gzip.py	(working copy)
@@ -25,4 +25,5 @@
 
         response.content = compress_string(response.content)
         response['Content-Encoding'] = 'gzip'
+        response['Content-Length'] = str(len(response.content))
         return response

Attachments

Change History

11/22/06 14:32:00 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [4089].


Add/Change #3052 (gzip middleware bug)




Change Properties
Action