diff options
-rw-r--r-- | apt-pkg/acquire-item.cc | 11 | ||||
-rwxr-xr-x | test/integration/test-method-mirror | 10 |
2 files changed, 16 insertions, 5 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index cc3d2f1ff..ab4306aac 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -3177,8 +3177,8 @@ void pkgAcqIndex::Init(string const &URI, string const &URIDesc, /* The only header we use is the last-modified header. */ string pkgAcqIndex::Custom600Headers() const { - - string msg = "\nIndex-File: true"; + std::string msg = pkgAcqBaseIndex::Custom600Headers(); + msg.append("\nIndex-File: true"); if (TransactionManager->LastMetaIndexParser == NULL) { @@ -3930,9 +3930,10 @@ void pkgAcqFile::Done(string const &Message,HashStringList const &CalcHashes, /*}}}*/ string pkgAcqFile::Custom600Headers() const /*{{{*/ { - if (IsIndexFile) - return "\nIndex-File: true"; - return ""; + string Header = pkgAcquire::Item::Custom600Headers(); + if (not IsIndexFile) + return Header; + return Header + "\nIndex-File: true"; } /*}}}*/ pkgAcqFile::~pkgAcqFile() {} diff --git a/test/integration/test-method-mirror b/test/integration/test-method-mirror index 56c9a10a0..81a5585fd 100755 --- a/test/integration/test-method-mirror +++ b/test/integration/test-method-mirror @@ -192,6 +192,16 @@ http://localhost:${APTHTTPPORT}/redirectme type:deb testfailure apt update testrundownload 'foo=2' +msgmsg 'Mirrors can be filtered by' 'by-hash type' +echo "http://localhost:${APTHTTPPORT}/failure type:foobar priority:1 +http://localhost:${APTHTTPPORT}/redirectme type:index type:deb +" > aptarchive/mirror.txt +rm -rf rootdir/var/lib/apt/lists +testsuccess apt update -o Acquire::By-Hash=force #-o Debug::pkgAcquire::Worker=1 +cp rootdir/tmp/testsuccess.output forcedbyhash.output +testfailure grep "localhost:${APTHTTPPORT}/failure" forcedbyhash.output +testrundownload 'foo=2' + msgmsg 'The prefix for the mirrorlist is' 'passed on' echo 'Dir::Bin::Methods::foo+mirror+file "mirror"; Dir::Bin::Methods::foo+mirror+http "mirror"; |