Commit 68ee8e5
Add patch to URL-escape key paths in HTTP remote URLs
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>1 parent d18a02c commit 68ee8e5
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments