summaryrefslogtreecommitdiffhomepage
path: root/test/python/targets/asgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/python/targets/asgi.py')
-rw-r--r--test/python/targets/asgi.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/python/targets/asgi.py b/test/python/targets/asgi.py
index b51f3964..749ec5b1 100644
--- a/test/python/targets/asgi.py
+++ b/test/python/targets/asgi.py
@@ -22,6 +22,23 @@ async def application_200(scope, receive, send):
)
+async def application_prefix(scope, receive, send):
+ assert scope['type'] == 'http'
+
+ await send(
+ {
+ 'type': 'http.response.start',
+ 'status': 200,
+ 'headers': [
+ (b'content-length', b'0'),
+ (b'prefix', scope.get('root_path', 'NULL').encode()),
+ ],
+ }
+ )
+
+ await send({'type': 'http.response.body', 'body': b''})
+
+
def legacy_application_200(scope):
assert scope['type'] == 'http'