diff options
author | Lakin Wecker <none@none> | 2007-10-16 21:11:06 +0000 |
---|---|---|
committer | Lakin Wecker <none@none> | 2007-10-16 21:11:06 +0000 |
commit | 638df083b53888335ad511ba515980af3edfa4ad (patch) | |
tree | 0d8fc6cd8c9c434bbfccc55d1cca59b9db756805 /cherrypy/lib/static.py | |
parent | 8055e06c8ac41f625d5d1d768e4ca791be5d22e5 (diff) | |
download | cherrypy-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.py | 3 |
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: |