short circuit depth check if current URL is already sufficient for ResourceInterface.resolveRelativeUrl#897
Merged
thescientist13 merged 1 commit intoMar 5, 2022
Conversation
1 task
ResourceInteface.resolveRelativeUrl
ResourceInteface.resolveRelativeUrlResourceInterface.resolveRelativeUrl
ResourceInterface.resolveRelativeUrlResourceInterface.resolveRelativeUrl
…race resolveRelativeUrl
thescientist13
force-pushed
the
enhancement/resource-interface-resolveRelativeUrl-current-depth-check
branch
from
March 5, 2022 16:57
1c90ba4 to
ea26291
Compare
thescientist13
deleted the
enhancement/resource-interface-resolveRelativeUrl-current-depth-check
branch
March 5, 2022 17:13
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.
…race resolveRelativeUrl
Related Issue
N / A
As part of AnalogStudiosRI/www.analogstudios.net#72, noticed that if I had a deep route like
/albums/some-album-name/Deeply nested paths and relative directories were causing issues, lead to file being loaded like this from the browser
This of course can be solved in userland already but requires a conditional with the current
ResourceInterface.resolveRelativeUrlbecause we start slicing and returnundefinedHowever, since the routing will always be dynamic, it would just a bit more ergonomic if
resolveRelativeUrlcould just help us out regardless of the scenarioSummary of Changes
ResourceInterface.resolveRelativeUrla little more ergonomic by just return the URL if it actually doesn't need to be resolved