github redirects from https to http

This commit is contained in:
Shay Banon 2011-08-01 09:12:58 +03:00
parent d3c0e250ec
commit c25d9a7842
1 changed files with 9 additions and 8 deletions

View File

@ -226,14 +226,15 @@ public class HttpDownloadHelper {
private boolean redirectionAllowed(URL aSource, URL aDest) throws IOException {
if (!(aSource.getProtocol().equals(aDest.getProtocol()) || ("http"
.equals(aSource.getProtocol()) && "https".equals(aDest
.getProtocol())))) {
String message = "Redirection detected from "
+ aSource.getProtocol() + " to " + aDest.getProtocol()
+ ". Protocol switch unsafe, not allowed.";
throw new IOException(message);
}
// Argh, github does this...
// if (!(aSource.getProtocol().equals(aDest.getProtocol()) || ("http"
// .equals(aSource.getProtocol()) && "https".equals(aDest
// .getProtocol())))) {
// String message = "Redirection detected from "
// + aSource.getProtocol() + " to " + aDest.getProtocol()
// + ". Protocol switch unsafe, not allowed.";
// throw new IOException(message);
// }
redirections++;
if (redirections > 5) {