fixed issue 1448, headers in wiki media files, sorry Nico this fell under the radar and tool way longer than should have
This commit is contained in:
2
VERSION
2
VERSION
@@ -1 +1 @@
|
||||
Version 2.6.0-development+timestamp.2013.08.29.21.15.25
|
||||
Version 2.6.0-development+timestamp.2013.08.29.21.31.47
|
||||
|
||||
@@ -5629,7 +5629,7 @@ class Wiki(object):
|
||||
return dict(content=content)
|
||||
|
||||
def media(self, id):
|
||||
request, db = current.request, self.auth.db
|
||||
request, response, db = current.request, current.response, self.auth.db
|
||||
media = db.wiki_media(id)
|
||||
if media:
|
||||
if self.settings.manage_permissions:
|
||||
@@ -5637,7 +5637,15 @@ class Wiki(object):
|
||||
if not self.can_read(page):
|
||||
return self.not_authorized(page)
|
||||
request.args = [media.filename]
|
||||
return current.response.download(request, db)
|
||||
m = response.download(request, db)
|
||||
current.session.forget() # get rid of the cookie
|
||||
response.headers['Last-Modified'] = \
|
||||
request.utcnow.strftime("%a, %d %b %Y %H:%M:%S GMT")
|
||||
if 'Content-Disposition' in response.headers:
|
||||
del response.headers['Content-Disposition']
|
||||
response.headers['Pragma'] = 'cache'
|
||||
response.headers['Cache-Control'] = 'private'
|
||||
return m
|
||||
else:
|
||||
raise HTTP(404)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user