summaryrefslogtreecommitdiff
path: root/methods/server.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-02-20 16:32:48 +0100
committerMichael Vogt <mvo@debian.org>2014-02-20 16:32:48 +0100
commitbef425ae689899d3add1f6a26b888012803a7308 (patch)
tree79ba0268c02129fbaaa1fb32c58904cb37ca1167 /methods/server.cc
parent74ac981563c6ccfd5291b6b6b83e193afa8aa40b (diff)
parent1c93747533dcf1cbbb2c743d0028ad157a7684a4 (diff)
Merge branch 'debian/sid' into ubuntu/master
Conflicts: configure.ac debian/changelog test/integration/test-kernel-helper-autoremove
Diffstat (limited to 'methods/server.cc')
-rw-r--r--methods/server.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/methods/server.cc b/methods/server.cc
index 76faa7e7f..6dd3970a6 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -291,11 +291,15 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
}
else
{
- NextURI = DeQuoteString(Server->Location);
- URI tmpURI = NextURI;
- // Do not allow a redirection to switch protocol
- if (tmpURI.Access == "http")
- return TRY_AGAIN_OR_REDIRECT;
+ NextURI = DeQuoteString(Server->Location);
+ URI tmpURI = NextURI;
+ URI Uri = Queue->Uri;
+ // same protocol redirects are okay
+ if (tmpURI.Access == Uri.Access)
+ return TRY_AGAIN_OR_REDIRECT;
+ // as well as http to https
+ else if (Uri.Access == "http" && tmpURI.Access == "https")
+ return TRY_AGAIN_OR_REDIRECT;
}
/* else pass through for error message */
}