forked from I2P_Developers/i2p.i2p
i2ptunnel: Fix multiple SSL outproxies in HTTP client
escape and truncate URL on error page
This commit is contained in:
@ -1224,7 +1224,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
||||
String s = getTunnel().getClientOptions().getProperty(PROP_SSL_OUTPROXIES);
|
||||
if (s == null)
|
||||
return null;
|
||||
String[] p = s.split(", ");
|
||||
String[] p = s.split("[,; \r\n\t]");
|
||||
if (p.length == 0)
|
||||
return null;
|
||||
// todo doesn't check for ""
|
||||
|
@ -215,11 +215,14 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
|
||||
// see TunnelController.setSessionOptions()
|
||||
String proxies = props.getProperty("proxyList");
|
||||
if (proxies != null) {
|
||||
StringTokenizer tok = new StringTokenizer(proxies, ", ");
|
||||
StringTokenizer tok = new StringTokenizer(proxies, ",; \r\n\t");
|
||||
synchronized(_proxyList) {
|
||||
_proxyList.clear();
|
||||
while (tok.hasMoreTokens())
|
||||
_proxyList.add(tok.nextToken().trim());
|
||||
while (tok.hasMoreTokens()) {
|
||||
String p = tok.nextToken().trim();
|
||||
if (p.length() > 0)
|
||||
_proxyList.add(tok.nextToken().trim());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
synchronized(_proxyList) {
|
||||
@ -664,11 +667,14 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
|
||||
Writer out = new BufferedWriter(new OutputStreamWriter(outs, "UTF-8"));
|
||||
out.write(errMessage);
|
||||
if (targetRequest != null) {
|
||||
String uri = targetRequest.replace("&", "&");
|
||||
String uri = DataHelper.escapeHTML(targetRequest);
|
||||
out.write("<a href=\"");
|
||||
out.write(uri);
|
||||
out.write("\">");
|
||||
out.write(uri);
|
||||
if (targetRequest.length() > 80)
|
||||
out.write(DataHelper.escapeHTML(targetRequest.substring(0, 75)) + "…");
|
||||
else
|
||||
out.write(uri);
|
||||
out.write("</a>");
|
||||
if (usingWWWProxy) {
|
||||
out.write("<br><br><b>");
|
||||
|
@ -1,3 +1,6 @@
|
||||
2015-03-31 zzz
|
||||
* i2ptunnel: Fix multiple SSL outproxies in HTTP client
|
||||
|
||||
2015-03-29 zzz
|
||||
* I2CP: Prevent NPE (ticket #1503)
|
||||
|
||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 13;
|
||||
public final static long BUILD = 14;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "-rc";
|
||||
|
Reference in New Issue
Block a user