Repository navigation
Conversation
No relative reference leads from an opaque part to a path, or back. route_from_path was called with the missing path and raised NoMethodError (undefined method 'scan' for nil); with dot segments or an authority, it returned a reference that merge cannot resolve back. Return the URI itself, as for different schemes. Assisted-by: Claude Opus 5.5 [Claude Code]
This branch has not been deployed
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.
URI('file:notes.txt').route_to('file:/home/alice/notes.txt')raisesNoMethodError: undefined method 'scan' for nil, and so does the reverse, becauseroute_from_pathgets the missing path of the opaque side. When the other side has an authority or dot segments, it returns a reference instead, but one that does not lead back to the target:URI('http:example.com').route_to('http://example.com/about')is//example.com/about, and merging that intohttp:example.comgiveshttp:example.comagain.No relative reference leads from an opaque part to a path or back, so this returns the URI itself, as
route_from0already does for different schemes. Only pairs where exactly one side is opaque change: I compared master and this branch on 200,000 random pairs, and the 100 that differ all raised or merged back wrong before, and all merge back to the target now.Two different opaque URIs of the same scheme are left as they are:
mailto:alice@example.comtomailto:bob@example.comgivesbob@example.com, which does not merge back either. Returning the URI itself there too would be a one-line change, but it touches a case that does not raise today, so I kept it out of this fix.