Edgewall Software
Modify

Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#7389 closed defect (wontfix)

[PATCH] Filesize less than original when downloading file under SSL

Reported by: zoltan.kovacs@… Owned by:
Priority: normal Milestone:
Component: web frontend Version:
Severity: normal Keywords: ssl https download needinfo
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When using Trac under HTTPS connection, the files downloaded using the send_file() function from apy.py has differ from original. The solution is to add 'Pragma: no-cache' header to the function.

Attachments (0)

Change History (7)

in reply to:  description comment:1 by zoltan.kovacs@…, 16 years ago

I cannot add attachment to ticket (internal trac error - UnicodeDecode), so I copy the patchfile to here:

Index: api.py
===================================================================
--- api.py      (revision 7274)
+++ api.py      (working copy)
@@ -386,6 +386,7 @@
                        'application/octet-stream'

         self.send_response(200)
+       self.send_header('Pragma', 'no-cache')
         self.send_header('Content-Type', mimetype)
         self.send_header('Content-Length', stat.st_size)
         self.send_header('Last-Modified', last_modified)

Replying to zoltan.kovacs@unitechnal.ch:

When using Trac under HTTPS connection, the files downloaded using the send_file() function from apy.py has differ from original. The solution is to add 'Pragma: no-cache' header to the function.

comment:2 by Remy Blank, 16 years ago

Keywords: needinfo added

I don't understand what the issue is. Do you mean that you can upload an attachment using HTTPS, and when you download it back, it differs from the original?

Could you please provide step-by-step instructions to reproduce the issue? Also specify the versions of the various components of your Trac installation, and what handler you use (tracd, mod_python, mod_wsgi).

comment:3 by anonymous, 16 years ago

I guess when downloading a version of an already existing file, then uploading a newer version and then downloading it again, the old version ist still "downloaded" from the local browser cache. I know that behaviour from various web sites.

comment:4 by Remy Blank, 16 years ago

Isn't that what the Last-Modified header is designed to avoid? I think Trac sets it to the mtime of the attachment, which should get updated when the attachment is replaced.

It is also strange that this only seems to happen with HTTPS connections.

in reply to:  3 comment:5 by Christian Boos, 16 years ago

Milestone: 0.11.6

Replying to anonymous:

I guess when downloading a version of an already existing file, then uploading a newer version and then downloading it again, the old version ist still "downloaded" from the local browser cache.

That would be a bug, need to verify.

comment:6 by Christian Boos, 15 years ago

Resolution: wontfix
Status: newclosed

No feedback provided to comment:2, closing.

comment:7 by Christian Boos, 15 years ago

Milestone: 0.12.1

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.