broken images and attachments. SSL related.
|Reported by:||Owned by:||Jonas Borgström|
|Severity:||normal||Keywords:||https ssl broken images attachments|
There is a problem in viewing images and dowloading attachments in https mode.
- Attachment image being show once normally.
- When you refresh page browser reports that image is broken.
- Again refresh - image again being shown normally.
This goes in a cyclic fashion.
With attachments also problem that attachment is being cached by the browser. So you often getting stale files after attachment was updated.
I found that that's all related to the cache control headers.
Here is a patch which fixes such behaviour:
Index: trac/web/main.py =================================================================== --- trac/web/main.py (revision 2067) +++ trac/web/main.py (working copy) @@ -218,9 +218,12 @@ self.send_response(200) if not mimetype: mimetype = mimetypes.guess_type(path) + + self.send_header('Cache-control', 'must-revalidate') + self.send_header('Expires', 'Fri, 01 Jan 1999 00:00:00 GMT') self.send_header('Content-Type', mimetype) self.send_header('Content-Length', stat.st_size) - self.send_header('Last-Modified', last_modified) + #self.send_header('Last-Modified', last_modified) self.end_headers() if self.method != 'HEAD':