fix(asgi): Stop duplicating scope["root_path"] in URLs#6579
Draft
alexander-alderman-webb wants to merge 11 commits into
Draft
fix(asgi): Stop duplicating scope["root_path"] in URLs#6579alexander-alderman-webb wants to merge 11 commits into
scope["root_path"] in URLs#6579alexander-alderman-webb wants to merge 11 commits into
Conversation
Contributor
Codecov Results 📊✅ 90500 passed | ⏭️ 6124 skipped | Total: 96624 | Pass Rate: 93.66% | Execution Time: 320m 23s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2409 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 89.85% 89.86% +0.01%
==========================================
Files 192 192 —
Lines 23745 23748 +3
Branches 8198 8198 —
==========================================
+ Hits 21334 21339 +5
- Misses 2411 2409 -2
- Partials 1344 1344 —Generated by Codecov Action |
scope["root_path"] in URLs
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add the
path_includes_root_pathboolean parameter to_get_url()and related functions.If the parameter is
True(the default),scope["path"]is considered to includescope["root_path"], wherescopeis the ASGI scope. Otherwise, the existing behavior that prependsscope["root_path"]when forming the url is preserved.Add tests to each ASGI-based integration. Some are compliant with the ASGI spec in which
scope["path"]includesscope["root_path"], while others are not. In particular, Starlite, LiterStar and old versions of Starlette are not compliant with the spec. In these cases,path_includes_root_path=Falseis set.Issues
Closes #6577
Reminders
uv run ruff.feat:,fix:,ref:,meta:)