Commit d1bdb73a authored by David Kalnischkies's avatar David Kalnischkies

methods: read config in most to least specific order

The implementation of the generic config fallback did the fallback in
the wrong order so that the least specific option wasn't the last value
picked but in fact the first one… doh!

So in the bugreports case http -> https -> http::<hostname> ->
https::<hostname> while it should have been the reverse as before.

Regression-In: 30060442
Closes: 834642
parent 1485040e
......@@ -86,10 +86,10 @@ public:
}
std::string ConfigFind(char const * const postfix, std::string const &defValue) const APT_NONNULL(2)
{
for (auto && name: methodNames)
for (auto name = methodNames.rbegin(); name != methodNames.rend(); ++name)
{
std::string conf;
strprintf(conf, "Acquire::%s::%s", name.c_str(), postfix);
strprintf(conf, "Acquire::%s::%s", name->c_str(), postfix);
auto const value = _config->Find(conf);
if (value.empty() == false)
return value;
......
......@@ -29,5 +29,6 @@ testfailure apt update
unset http_proxy
testsuccess grep 'Unsupported proxy configured' rootdir/tmp/testfailure.output
echo 'Acquire::http::Proxy "foo://example.org";
Acquire::https::Proxy "DIRECT";' > rootdir/etc/apt/apt.conf.d/proxy.conf
testsuccess apt update
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment