summaryrefslogtreecommitdiff
path: root/tests/urlparser_data/not_found/recur/__init__.py
blob: 48205a5b6b5e62a82c203daf75c39e8e3bba8edc (plain)
1
2
3
4
5
6
7
8
9
def not_found_hook(environ, start_response):
    urlparser = environ['paste.urlparser.not_found_parser']
    path = environ.get('PATH_INFO', '')
    if not path:
        return urlparser.not_found(environ, start_response)
    # Strip off leading _'s
    path = '/' + path.lstrip('/').lstrip('_')
    environ['PATH_INFO'] = path
    return urlparser(environ, start_response)