summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2020-07-10 20:19:31 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2020-12-18 20:45:35 +0100
commita5859bafdaa6bcf12934d0fb1715a5940965e13a (patch)
treee0cb170d0a4f8caff89c2402bf24e6951b716360 /apt-pkg
parent97d6c3b2d05fe0d965657197adf56cc78f9edf81 (diff)
Don't re-encode encoded URIs in pkgAcqFile
This commit potentially breaks code feeding apt an encoded URI using a method which does not get URIs send encoded. The webserverconfig requests in our tests are an example for this – but they only worked before if the server was expecting a double encoding as that was what was happening to an encoded URI: so unlikely to work as expected in practice. Now with the new methods we can drop this double encoding and rely on the URI being passed properly (and without modification) between the layers so that passing in encoded URIs should now work correctly.
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 34528f2ec..a4ad6b854 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -3860,7 +3860,8 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *const Owner, string const &URI, HashStringLis
DestFile = flNotDir(URI);
::URI url{URI};
- url.Path = pkgAcquire::URIEncode(url.Path);
+ if (url.Path.find(' ') != std::string::npos || url.Path.find('%') == std::string::npos)
+ url.Path = pkgAcquire::URIEncode(url.Path);
// Create the item
Desc.URI = std::string(url);