[static-file] return Unauthorized on blocked directory listing
This is more appropriate than 404 NOT FOUND
--- a/web/views/staticcontrollers.py Tue Mar 20 18:28:24 2012 +0100
+++ b/web/views/staticcontrollers.py Tue Mar 20 18:29:13 2012 +0100
@@ -31,6 +31,7 @@
from datetime import datetime, timedelta
from logging import getLogger
+from cubicweb import Unauthorized
from cubicweb.web import NotFound
from cubicweb.web.http_headers import generateDateTime
from cubicweb.web.controller import Controller
@@ -58,7 +59,7 @@
if osp.isdir(path):
if self.directory_listing_allowed:
return u''
- raise NotFound(path)
+ raise Unauthorized(path)
if not osp.isfile(path):
raise NotFound()
if not debugmode: