File: __init__.py

package info (click to toggle)
paste 3.5.2%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,424 kB
  • sloc: python: 18,933; javascript: 8,028; sh: 24; makefile: 16
file content (9 lines) | stat: -rw-r--r-- 374 bytes parent folder | download | duplicates (14)
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)