-
-
Notifications
You must be signed in to change notification settings - Fork 862
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Refactor logic to handle
root_path
to keep compatibility with AS…
…GI and compatibility with other non-Starlette-specific libraries like a2wsgi (#2400) * ✨ Add util to get route path from scope * ♻️ Refactor extracting the local route_path from the scope, and creating the child scope with its own root_pat, this allows sub-apps (e.g. WSGIMiddleware) to know where it was mounted, and from which path prefix starts the path its sub-app should handle * ♻️ Refactor datastructures and request to be conformant with the ASGI spec, respecting root_path * ✅ Add and update tests for root_path with mounted apps that don't know about Starlette internals (e.g. the route_root_path extension scope key that was added in * ✅ Update test for root_path, TestClient was not requiring paths under a root_path to pass the root_path, which is what clients would have to do if the app is mounted. * 🎨 Fix formatting * 🎨 Remove type ignore * 🔥 Remove unnecessary comment * ✨ Update (deprecated) WSGIMiddleware to be compatible with the updated root_path, taking pieces from a2wsgi * 🎨 Fix types * ✅ Update test for WSGIMiddleware with root_path * 🔥 Remove logic/features not in the original (deprecated) WSGIMiddleware --------- Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com> Co-authored-by: Aber <me@abersheeran.com>
- Loading branch information
1 parent
8f2307d
commit c3c6314
Showing
8 changed files
with
90 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters