* HTTP Proxy:
- Restore the localhost error message - Catch 127.0.0.1:xxxx addresses too
This commit is contained in:
@ -404,6 +404,16 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
|||||||
}
|
}
|
||||||
|
|
||||||
line = method + " " + request.substring(pos);
|
line = method + " " + request.substring(pos);
|
||||||
|
} else if (host.toLowerCase().equals("localhost") || host.equals("127.0.0.1")) {
|
||||||
|
if (out != null) {
|
||||||
|
out.write(ERR_LOCALHOST);
|
||||||
|
out.write("<p /><i>Generated on: ".getBytes());
|
||||||
|
out.write(new Date().toString().getBytes());
|
||||||
|
out.write("</i></body></html>\n".getBytes());
|
||||||
|
out.flush();
|
||||||
|
}
|
||||||
|
s.close();
|
||||||
|
return;
|
||||||
} else if (host.indexOf(".") != -1) {
|
} else if (host.indexOf(".") != -1) {
|
||||||
// rebuild host
|
// rebuild host
|
||||||
host = host + ":" + port;
|
host = host + ":" + port;
|
||||||
@ -431,16 +441,6 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
|
|||||||
usingWWWProxy = true;
|
usingWWWProxy = true;
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug(getPrefix(requestId) + "Host doesnt end with .i2p and it contains a period [" + host + "]: wwwProxy!");
|
_log.debug(getPrefix(requestId) + "Host doesnt end with .i2p and it contains a period [" + host + "]: wwwProxy!");
|
||||||
} else if (host.toLowerCase().startsWith("localhost:")) {
|
|
||||||
if (out != null) {
|
|
||||||
out.write(ERR_LOCALHOST);
|
|
||||||
out.write("<p /><i>Generated on: ".getBytes());
|
|
||||||
out.write(new Date().toString().getBytes());
|
|
||||||
out.write("</i></body></html>\n".getBytes());
|
|
||||||
out.flush();
|
|
||||||
}
|
|
||||||
s.close();
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
request = request.substring(pos + 1);
|
request = request.substring(pos + 1);
|
||||||
pos = request.indexOf("/");
|
pos = request.indexOf("/");
|
||||||
|
Reference in New Issue
Block a user