Decode SCP URI components and remove IPv6 address brackets - #94
Open
OskarEichler wants to merge 1 commit into
Open
Decode SCP URI components and remove IPv6 address brackets#94OskarEichler wants to merge 1 commit into
OskarEichler wants to merge 1 commit into
Conversation
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.
Summary
Decode percent escapes in SCP URI user/password/path components once, preserve literal plus signs, and pass an unbracketed IPv6 hostname to the SSH layer.
Reproduction and evidence
With a captured download! call,
scp://a%2Bb:p%40ss@[::1]:2222/a%20bpreviously forwarded[::1],a%2Bband/a%20b. It now forwards::1,a+band/a b, with the password decoded top@ss. Twenty-four focused assertions cover DNS/IPv6 hosts, escaped spaces, literal plus signs, double-escaped percent text and UTF-8 paths. Combined local scp-backed URI.open integration transfers a file whose name contains a space.Compatibility / breaking changes
URI components now receive normal URI decoding. A literal percent escape in an actual remote name must be encoded as %25 in the URI. No form-style plus-to-space decoding is used. Correct forwarding of URI port/password into :ssh is a separate PR; this patch only corrects component representation.
Verification and limits