summaryrefslogtreecommitdiff
path: root/cherrypy/lib/static.py
diff options
context:
space:
mode:
authorLakin Wecker <none@none>2007-10-16 21:11:06 +0000
committerLakin Wecker <none@none>2007-10-16 21:11:06 +0000
commit638df083b53888335ad511ba515980af3edfa4ad (patch)
tree0d8fc6cd8c9c434bbfccc55d1cca59b9db756805 /cherrypy/lib/static.py
parent8055e06c8ac41f625d5d1d768e4ca791be5d22e5 (diff)
downloadcherrypy-git-638df083b53888335ad511ba515980af3edfa4ad.tar.gz
Static tool: allow the use of ~ as a placeholder for a the user's home directory in the path names.
Diffstat (limited to 'cherrypy/lib/static.py')
-rw-r--r--cherrypy/lib/static.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cherrypy/lib/static.py b/cherrypy/lib/static.py
index 8ef70ea9..0e3e28a5 100644
--- a/cherrypy/lib/static.py
+++ b/cherrypy/lib/static.py
@@ -152,6 +152,9 @@ def staticdir(section, dir, root="", match="", content_types=None, index=""):
if match and not re.search(match, cherrypy.request.path_info):
return False
+ # Allow the use of '~' to refer to a user's home directory.
+ dir = os.path.expanduser(dir)
+
# If dir is relative, make absolute using "root".
if not os.path.isabs(dir):
if not root: