diff options
Diffstat (limited to 'tests/urlparser_data/not_found/user/__init__.py')
-rw-r--r-- | tests/urlparser_data/not_found/user/__init__.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/urlparser_data/not_found/user/__init__.py b/tests/urlparser_data/not_found/user/__init__.py new file mode 100644 index 0000000..4126c04 --- /dev/null +++ b/tests/urlparser_data/not_found/user/__init__.py @@ -0,0 +1,12 @@ +from paste import request + +def not_found_hook(environ, start_response): + urlparser = environ['paste.urlparser.not_found_parser'] + first, rest = request.path_info_split(environ.get('PATH_INFO', '')) + if not first: + # No username + return + environ['app.user'] = first + environ['SCRIPT_NAME'] += '/' + first + environ['PATH_INFO'] = rest + return urlparser(environ, start_response) |