Add patch to URL-escape key paths in HTTP remote URLs#251
Merged
yarikoptic merged 1 commit intomasterfrom Feb 13, 2026
Merged
Conversation
keyUrls in Remote/Git.hs constructs URLs for fetching content from HTTP git remotes by simple string concatenation of the repo URL and the annex object path. When the key contains characters that keyFile encodes using git-annex's internal escaping (& for colons, % for slashes), the resulting URL contains bare % and & characters that are invalid in a URI path -- % must be followed by two hex digits per RFC 3986, and the parser rejects the URL as "invalid url". This affects URL-backend keys like URL--yt:https://www.youtube.com/watch?v=... where keyFile produces paths containing &c (for :) and %% (for //), resulting in unparseable URLs. SHA256E and other hash-based keys are unaffected since their serialized forms contain only URI-safe characters. The fix applies escapeURIString (from Network.URI, already imported) to percent-encode the path components while preserving / as a path separator. This is the same approach used by Remote/S3.hs and Remote/WebDAV/DavLocation.hs. See https://git-annex.branchable.com/bugs/fails_to_get_from_apache2_server_URL_backend_file/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
for mac - no money. Ubuntu datalad tests fails on FAILED ../datalad/core/distributed/tests/test_clone.py::test_ria_postclone_noannex - assert not True -- not new |
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.
keyUrls in Remote/Git.hs constructs URLs for fetching content from HTTP git remotes by simple string concatenation of the repo URL and the annex object path. When the key contains characters that keyFile encodes using git-annex's internal escaping (& for colons, % for slashes), the resulting URL contains bare % and & characters that are invalid in a URI path -- % must be followed by two hex digits per RFC 3986, and the parser rejects the URL as "invalid url".
This affects URL-backend keys like
URL--yt:https://www.youtube.com/watch?v=... where keyFile produces paths containing &c (for :) and %% (for //), resulting in unparseable URLs. SHA256E and other hash-based keys are unaffected since their serialized forms contain only URI-safe characters.
The fix applies escapeURIString (from Network.URI, already imported) to percent-encode the path components while preserving / as a path separator. This is the same approach used by Remote/S3.hs and Remote/WebDAV/DavLocation.hs.
See https://git-annex.branchable.com/bugs/fails_to_get_from_apache2_server_URL_backend_file/