Ticket #2006 (closed defect: fixed)
broken images and attachments. SSL related.
| Reported by: | tiger@… | Owned by: | jonas |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.9.4 |
| Component: | general | Version: | devel |
| Severity: | normal | Keywords: | https ssl broken images attachments |
| Cc: | tiger@…, nielsen@… |
Description
There is a problem in viewing images and dowloading attachments in https mode.
Symptoms:
- 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)[0]
+
+ 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':
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


