I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit e2e43cd5 authored by zzz's avatar zzz
Browse files

* EepGet: Don't convert a MalformedURLException into

      an IOE so we recognize it when it's throuwn
parent 43b4fe83
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment