forked from I2P_Developers/i2p.i2p
* EepGet: Don't convert a MalformedURLException into
an IOE so we recognize it when it's throuwn
This commit is contained in:
@@ -507,7 +507,7 @@ public class EepGet {
|
||||
timeout.setInactivityTimeout(INACTIVITY_TIMEOUT);
|
||||
|
||||
if (_redirectLocation != null) {
|
||||
try {
|
||||
//try {
|
||||
URL oldURL = new URL(_actualURL);
|
||||
String query = oldURL.getQuery();
|
||||
if (query == null) query = "";
|
||||
@@ -525,9 +525,10 @@ public class EepGet {
|
||||
if ( (_actualURL.indexOf('?') < 0) && (query.length() > 0) )
|
||||
_actualURL = _actualURL + "?" + query;
|
||||
}
|
||||
} catch (MalformedURLException mue) {
|
||||
throw new IOException("Redirected from an invalid URL");
|
||||
}
|
||||
// an MUE is an IOE
|
||||
//} catch (MalformedURLException mue) {
|
||||
// throw new IOException("Redirected from an invalid URL");
|
||||
//}
|
||||
_redirects++;
|
||||
if (_redirects > 5)
|
||||
throw new IOException("Too many redirects: to " + _redirectLocation);
|
||||
@@ -874,7 +875,7 @@ public class EepGet {
|
||||
if (_shouldProxy) {
|
||||
_proxy = InternalSocket.getSocket(_proxyHost, _proxyPort);
|
||||
} else {
|
||||
try {
|
||||
//try {
|
||||
URL url = new URL(_actualURL);
|
||||
if ("http".equals(url.getProtocol())) {
|
||||
String host = url.getHost();
|
||||
@@ -885,9 +886,10 @@ public class EepGet {
|
||||
} else {
|
||||
throw new IOException("URL is not supported:" + _actualURL);
|
||||
}
|
||||
} catch (MalformedURLException mue) {
|
||||
throw new IOException("Request URL is invalid");
|
||||
}
|
||||
// an MUE is an IOE
|
||||
//} catch (MalformedURLException mue) {
|
||||
// throw new IOException("Request URL is invalid");
|
||||
//}
|
||||
}
|
||||
_proxyIn = _proxy.getInputStream();
|
||||
_proxyOut = _proxy.getOutputStream();
|
||||
|
||||
@@ -117,7 +117,7 @@ public class EepHead extends EepGet {
|
||||
timeout.setInactivityTimeout(60*1000);
|
||||
|
||||
if (_redirectLocation != null) {
|
||||
try {
|
||||
//try {
|
||||
URL oldURL = new URL(_actualURL);
|
||||
String query = oldURL.getQuery();
|
||||
if (query == null) query = "";
|
||||
@@ -135,9 +135,10 @@ public class EepHead extends EepGet {
|
||||
if ( (_actualURL.indexOf('?') < 0) && (query.length() > 0) )
|
||||
_actualURL = _actualURL + "?" + query;
|
||||
}
|
||||
} catch (MalformedURLException mue) {
|
||||
throw new IOException("Redirected from an invalid URL");
|
||||
}
|
||||
// an MUE is an IOE
|
||||
//} catch (MalformedURLException mue) {
|
||||
// throw new IOException("Redirected from an invalid URL");
|
||||
//}
|
||||
_redirects++;
|
||||
if (_redirects > 5)
|
||||
throw new IOException("Too many redirects: to " + _redirectLocation);
|
||||
|
||||
@@ -286,7 +286,7 @@ public class SSLEepGet extends EepGet {
|
||||
|
||||
String req = getRequest();
|
||||
|
||||
try {
|
||||
//try {
|
||||
URL url = new URL(_actualURL);
|
||||
if ("https".equals(url.getProtocol())) {
|
||||
String host = url.getHost();
|
||||
@@ -301,9 +301,10 @@ public class SSLEepGet extends EepGet {
|
||||
} else {
|
||||
throw new IOException("Only https supported: " + _actualURL);
|
||||
}
|
||||
} catch (MalformedURLException mue) {
|
||||
throw new IOException("Request URL is invalid");
|
||||
}
|
||||
// an MUE is an IOE
|
||||
//} catch (MalformedURLException mue) {
|
||||
// throw new IOException("Request URL is invalid");
|
||||
//}
|
||||
|
||||
_proxyIn = _proxy.getInputStream();
|
||||
_proxyOut = _proxy.getOutputStream();
|
||||
|
||||
Reference in New Issue
Block a user