summaryrefslogtreecommitdiff
path: root/cherrypy/lib/static.py
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2007-06-16 23:35:25 +0000
committerRobert Brewer <fumanchu@aminus.org>2007-06-16 23:35:25 +0000
commit3677bda130521fa2462ee75a6813b0c91ba0b593 (patch)
tree80b9c4455610a59341886d2b19fbf48075c18f98 /cherrypy/lib/static.py
parent7ed13676afeefdb79aa2b4e2e6809e0759357361 (diff)
downloadcherrypy-git-3677bda130521fa2462ee75a6813b0c91ba0b593.tar.gz
Fix for #689 (add equivalent of trailing_slash tool for static content). The staticdir tool now sets request.is_index if needed. The trailing_slash tool priority was increased to allow most before_handler tools a chance to set is_index.
Diffstat (limited to 'cherrypy/lib/static.py')
-rw-r--r--cherrypy/lib/static.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cherrypy/lib/static.py b/cherrypy/lib/static.py
index dee635e7..8ef70ea9 100644
--- a/cherrypy/lib/static.py
+++ b/cherrypy/lib/static.py
@@ -179,8 +179,10 @@ def staticdir(section, dir, root="", match="", content_types=None, index=""):
handled = _attempt(filename, content_types)
if not handled:
# Check for an index file if a folder was requested.
- if index and filename[-1] in (r"\/"):
+ if index:
handled = _attempt(os.path.join(filename, index), content_types)
+ if handled:
+ cherrypy.request.is_index = filename[-1] in (r"\/")
return handled
def staticfile(filename, root=None, match="", content_types=None):