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