-
Notifications
You must be signed in to change notification settings - Fork 240
How should servers utilise root_path #229
Copy link
Copy link
Closed
Description
root_path is often considered equivalent to WSGI's SCRIPT_NAME, yet usage of root_path by servers differs in that WSGI servers seem to split out the SCRIPT_NAME from the PATH_INFO whereas ASGI servers (Daphne, Hypercorn, Uvicorn) do not,
I find (for all 3 ASGI servers, with daphne shown),
$ SCRIPT_NAME="/bob" gunicorn t110:app
>> environ = {'RAW_URI': '/bob/', 'PATH_INFO': '/', 'SCRIPT_NAME': '/bob', ...}
$ daphne --root-path "/bob" t110:app
>> scope = {'path': '/bob/', 'raw_path': b'/bob/', 'root_path': '/bob', ...}
whereas I think the scope should be,
>> scope = {'path': '/', 'raw_path': b'/bob/', 'root_path': '/bob', ...}
I.e. the server should 404 if the request target does not start with the root_path, and if it does remove it from the path, but keep it in the raw_path. Are the current ASGI servers correct, or does the ASGI spec need to be clearer about this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels