diff MoinMoin/action/AttachFile.py @ 5981:3460b27e7f3e

AttachFile do=get and do=view: send 404 status if file does not exist
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 06 Apr 2013 22:47:36 +0200
parents 378bfb1d0eec
children b85dc05a75e1
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sat Apr 06 00:21:51 2013 +0200
+++ b/MoinMoin/action/AttachFile.py	Sat Apr 06 22:47:36 2013 +0200
@@ -865,6 +865,7 @@
     if not request.user.may.read(pagename):
         return _('You are not allowed to get attachments from this page.')
     if not filename:
+        request.status_code = 404
         return # error msg already sent in _access_file
 
     timestamp = datetime.datetime.fromtimestamp(os.path.getmtime(fpath))
@@ -1139,6 +1140,7 @@
     if not request.user.may.read(pagename):
         return _('You are not allowed to view attachments of this page.')
     if not filename:
+        request.status_code = 404
         return
 
     request.formatter.page = Page(request, pagename)