~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/studpath.py

Fix public mode serve authorization to traverse to the deepest directory,
not just the previous path segment. Otherwise PATH_INFO can't be used in
public mode - it takes PATH_INFO to be part of the authorization path

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
    raised on failure.
164
164
    """
165
165
    _, path = url_to_local(req.path)
166
 
    dirpath, _ = os.path.split(path)
167
 
    if not (worldreadable(dirpath) and published(dirpath)):
 
166
 
 
167
    # Walk up the tree, and find the deepest directory.
 
168
    while not os.path.isdir(path):
 
169
        path = os.path.dirname(path)
 
170
 
 
171
    if not (worldreadable(path) and published(path)):
168
172
        return False
169
173
    return True