Code

Opened 7 years ago

Closed 7 years ago

#3052 closed defect (fixed)

gzip middleware bug

Reported by: simonbun <simonbun@…> Owned by: adrian
Component: Core (Other) Version:
Severity: minor Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (0)

Change History (1)

comment:1 Changed 7 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [4089].

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.