diff MoinMoin/action/AttachFile.py @ 4183:fc20a076aad0

Accomodate for consolidation of Request/Response
author Florian Krupicka <florian.krupicka@googlemail.com>
date Sat, 21 Jun 2008 16:57:20 +0200
parents 85884c67228d
children 40acd13fb3d6
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Thu Jun 19 18:23:02 2008 +0200
+++ b/MoinMoin/action/AttachFile.py	Sat Jun 21 16:57:20 2008 +0200
@@ -809,7 +809,7 @@
     timestamp = os.path.getmtime(fpath)
     if_modified = time.mktime(request.if_modified_since.timetuple())
     if if_modified >= timestamp:
-        request.response.status_code = 304
+        request.status_code = 304
     else:
         mt = wikiutil.MimeType(filename=filename)
         content_type = mt.content_type()
@@ -825,11 +825,11 @@
         dangerous = mime_type in request.cfg.mimetypes_xss_protect
         content_dispo = dangerous and 'attachment' or 'inline'
 
-        request.response.content_type = content_type
-        request.response.last_modified = timestamp
-        request.response.content_length = os.path.getsize(fpath)
+        request.content_type = content_type
+        request.last_modified = timestamp
+        request.content_length = os.path.getsize(fpath)
         content_dispo_string = '%s; filename="%s"' % (content_dispo, filename_enc)
-        request.response.headers.add('Content-Disposition', content_dispo_string)
+        request.headers.add('Content-Disposition', content_dispo_string)
 
         # send data
         request.send_file(open(fpath, 'rb'))