Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 10 years ago

#3707 closed defect (invalid)

'Content-Length' is missing for downloads of wiki-attachments

Reported by: schuetze@… Owned by: Jonas Borgström
Priority: normal Milestone:
Component: wiki system Version: 0.10b1
Severity: normal Keywords: needinfo
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

If I download an executable (attachment of a wiki page), my download-client doesn't receive the 'Content-Length'-HTTP-header. For downloading any binaries of the SVN-repository (via 'Browse Source'), this header is available.

Attachments (0)

Change History (4)

comment:1 by Matthew Good, 18 years ago

Keywords: needinfo added

Can you provide a listing of the headers you do get? A listing of the headers sent from your client may also be helpful here.

comment:2 by anonymous, 18 years ago

My configuration:
Apache:2.0.55 (WinNT) PHP:4.4.2 SVN:1.3.0 mod_python:3.1.3 Python:2.3.2 Trac:0.10b1

I found the problem … I've sent to the server a HEAD request to check the size of the file that will be downloaded - the 'Content-Length' is missing in this response. If I send a GET request, the HTTP-header is complete (with 'Content-Length'). This behavior appears only if I access an attachment of a wiki page. If I access a binary of the SVN repository via 'Browse Source', the answer-headers of GET and HEAD are the same!

'access.log' of Apache
1st Line: HEAD-Request of a wiki-attachment
2nd Line: HEAD-Request of a SVN-binary
(the GET-Requests are the same - only replace HEAD by GET)

192.168.40.105 - - [13/Sep/2006:11:00:27 +0200] "HEAD /projects/app/attachment/wiki/AppRelease/AppV3alpha5.exe?format=raw HTTP/1.1" 200 -
192.168.40.105 - - [13/Sep/2006:11:08:52 +0200] "HEAD /projects/app/browser/Releases/App-V2.28/Report/Templates/dashboard-main.html?format=raw HTTP/1.1" 200 -

Response to a HEAD-request of a wiki-attachment:

HTTP/1.1 200 OK
Date: Wed, 13 Sep 2006 09:20:57 GMT
Server: Apache/2.0.55 (Win32) DAV/2 PHP/4.4.2 SVN/1.3.0 mod_python/3.1.3 Python/2.3.2
ETag: W"anonymous/1157717419/"
Content-Disposition: attachment;filename=AppV3alpha5.exe
Last-Modified: Fri, 08 Sep 2006 12:10:19 GMT
Content-Type: application/octet-stream; charset=iso-8859-15

Response to a HEAD-request of a SVN-binary:

HTTP/1.1 200 OK
Date: Wed, 13 Sep 2006 09:21:55 GMT
Server: Apache/2.0.55 (Win32) DAV/2 PHP/4.4.2 SVN/1.3.0 mod_python/3.1.3 Python/2.3.2
Content-Disposition: attachment;filename=dashboard-main.html
Content-Length: 695
Last-Modified: Mon, 31 Oct 2005 10:40:28 GMT
Content-Type: text/html; charset=iso-8859-15

Response to a GET-request of a wiki-attachment:

HTTP/1.1 200 OK
Date: Wed, 13 Sep 2006 09:21:17 GMT
Server: Apache/2.0.55 (Win32) DAV/2 PHP/4.4.2 SVN/1.3.0 mod_python/3.1.3 Python/2.3.2
ETag: W"anonymous/1157717419/"
Content-Disposition: attachment;filename=AppV3alpha5.exe
Content-Length: 4935680
Last-Modified: Fri, 08 Sep 2006 12:10:19 GMT
Content-Type: application/octet-stream; charset=iso-8859-15

Response to a GET-request of a SVN-binary:

HTTP/1.1 200 OK
Date: Wed, 13 Sep 2006 09:22:25 GMT
Server: Apache/2.0.55 (Win32) DAV/2 PHP/4.4.2 SVN/1.3.0 mod_python/3.1.3 Python/2.3.2
Content-Disposition: attachment;filename=dashboard-main.html
Content-Length: 695
Last-Modified: Mon, 31 Oct 2005 10:40:28 GMT
Content-Type: text/html; charset=iso-8859-15

in reply to:  2 comment:3 by Matthew Good, 18 years ago

Replying to anonymous:

I found the problem … I've sent to the server a HEAD request to check the size of the file that will be downloaded - the 'Content-Length' is missing in this response. If I send a GET request, the HTTP-header is complete (with 'Content-Length'). This behavior appears only if I access an attachment of a wiki page. If I access a binary of the SVN repository via 'Browse Source', the answer-headers of GET and HEAD are the same!

I am unable to reproduce this on Apache with mod_python or FastCGI or with tracd. And looking at the code backs up what I'm seeing, which is that Trac is always sending the same headers.

Here are the headers for an exe file attached to the WIki:

HTTP/1.1 200 OK
Date: Wed, 13 Sep 2006 17:46:31 GMT
Server: Apache/2.0.55 (Ubuntu) mod_fastcgi/2.4.2 mod_python/3.1.4 Python/2.4.3
ETag: W"anonymous/1158169124/"
Content-Length: 29184
Last-Modified: Wed, 13 Sep 2006 17:38:44 GMT
Set-Cookie: trac_session=739550509837b0e8c13086e0; expires=Tue, 12-Dec-2006 17:46:40 GMT; Path=/trac-mod-python;
Connection: close
Content-Type: application/x-msdos-program; charset=iso-8859-15

Event the "Content-Type" in your headers is incorrect since Trac would have guessed the mimetype from the ".exe" extension. Please make sure that you don't have any Apache modules or proxies between you and the server that may be changing the headers. You may want to test with tracd as well to see if you get the same behavior.

comment:4 by Matthew Good, 18 years ago

Resolution: invalid
Status: newclosed

Closing due to lack of info. If you are unable to resolve this please try the MailingList for support, or reopen this ticket if you can provide more information to help in debugging.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström 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.