diff options
| author | ianb <devnull@localhost> | 2005-08-22 21:11:50 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-08-22 21:11:50 +0000 |
| commit | a171c7d41358b02b3a1859732318bb1fde82fcd7 (patch) | |
| tree | df23a0f3712044eb1fbb6a1a8e665e69956df76e /tests/urlparser_data/hook | |
| parent | c77d41d16bfadbfbba203a65ac5777545958755d (diff) | |
| download | paste-a171c7d41358b02b3a1859732318bb1fde82fcd7.tar.gz | |
Moved test
Diffstat (limited to 'tests/urlparser_data/hook')
| -rw-r--r-- | tests/urlparser_data/hook/__init__.py | 10 | ||||
| -rw-r--r-- | tests/urlparser_data/hook/app.py | 5 | ||||
| -rw-r--r-- | tests/urlparser_data/hook/index.py | 4 |
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/urlparser_data/hook/__init__.py b/tests/urlparser_data/hook/__init__.py new file mode 100644 index 0000000..9b1055c --- /dev/null +++ b/tests/urlparser_data/hook/__init__.py @@ -0,0 +1,10 @@ +from paste import wsgilib + +def urlparser_hook(environ): + first, rest = wsgilib.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 diff --git a/tests/urlparser_data/hook/app.py b/tests/urlparser_data/hook/app.py new file mode 100644 index 0000000..d2714e5 --- /dev/null +++ b/tests/urlparser_data/hook/app.py @@ -0,0 +1,5 @@ +def application(environ, start_response): + start_response('200 OK', [('Content-type', 'text/html')]) + return ['user: %s' % environ['app.user']] + + diff --git a/tests/urlparser_data/hook/index.py b/tests/urlparser_data/hook/index.py new file mode 100644 index 0000000..49e89f0 --- /dev/null +++ b/tests/urlparser_data/hook/index.py @@ -0,0 +1,4 @@ +def application(environ, start_response): + start_response('200 OK', [('Content-type', 'text/html')]) + return ['index: %s' % environ['app.user']] + |
