From 5674f6b3163d73260e25ce7d350aaac50071eb0e Mon Sep 17 00:00:00 2001 From: Raphael Geissert Date: Mon, 14 May 2012 18:07:01 +0200 Subject: * apt-pkg/acquire*.cc: - handle redirections in the worker with the right method instead of in the method the redirection occured in (Closes: #668111) * methods/http.cc: - forbid redirects to change protocol --- methods/http.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/http.cc b/methods/http.cc index b450b6ffc..bb02176e9 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -985,7 +985,10 @@ HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv) else { NextURI = DeQuoteString(Srv->Location); - return TRY_AGAIN_OR_REDIRECT; + URI tmpURI = NextURI; + // Do not allow a redirection to switch protocol + if (tmpURI.Access == "http") + return TRY_AGAIN_OR_REDIRECT; } /* else pass through for error message */ } -- cgit v1.2.3