fix: normalize root_path_skip_prefixes in ProcessLinksMiddleware - #199
Open
lhoupert wants to merge 1 commit into
Open
fix: normalize root_path_skip_prefixes in ProcessLinksMiddleware#199lhoupert wants to merge 1 commit into
lhoupert wants to merge 1 commit into
Conversation
A trailing slash in a directly-passed prefix (e.g. ["/raster/"]) matched nothing, silently disabling the skip and re-adding ROOT_PATH to sibling-app links. Env-var configuration was unaffected (the Settings validator normalizes), but ProcessLinksMiddleware is exported from stac_auth_proxy.middleware and gave no error. Restore the middleware-level normalization and its regression test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Claude finished @lhoupert's task in 1m 2s —— View job Review complete
✅ No blocking issues — safe to merge. The fix is minimal and correctly targeted:
No security or correctness concerns. No test or lint gaps. Simplify (ponytail) Nothing to cut — this is already the minimal fix (one 💰 Estimated review cost: $0.41 · 1m01s · 15 turns |
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.
Addressing edge case 1 in #200: If you pass a skip prefix with a trailing slash straight to the middleware (e.g. ["/raster/"]), it never matches any link. The skip list just stops working and links to sibling apps get ROOT_PATH added again (the issue #198 tried to prevent). Configuration via env vars is unaffected as the Settings validator normalizes the prefixes (strips trailing slashes, drops empties) before they reach the middleware, but not ProcessLinksMiddleware when it is constructed directly (prefixes passed directly to ProcessLinksMiddleware dont get such normalization)