diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 55473717f..feb955126 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -143,6 +143,17 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn "or naming one of them differently.
") .getBytes(); + private final static byte[] ERR_AHELPER_NOTFOUND = + ("HTTP/1.1 404 Not Found\r\n"+ + "Content-Type: text/html; charset=iso-8859-1\r\n"+ + "Cache-control: no-cache\r\n"+ + "\r\n"+ + "
" + _("This seems to be a bad destination:") + " " + ahelperKey + " " + _("i2paddresshelper cannot help you with a destination like that!") + "
").getBytes("UTF-8")); + writeFooter(out); + // XXX: should closeSocket(s) be in a finally block? + closeSocket(s); + return; + } ahelperKey = dest.toBase64(); - } + } + ahelperPresent = true; // ahelperKey will be validated later if (host == null || "i2p".equals(host)) { @@ -490,6 +516,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn if (_log.shouldLog(Log.WARN)) _log.warn(getPrefix(requestId) + "Addresshelper key conflict for site [" + destination + "], trusted key [" + destB64 + "], specified key [" + ahelperKey + "]."); + } } } @@ -524,7 +551,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn byte[] header = getErrorPage("ahelper-conflict", ERR_AHELPER_CONFLICT); out.write(header); out.write(_("To visit the destination in your host database, click here. To visit the conflicting addresshelper destination, click here.", trustedURL, conflictURL).getBytes("UTF-8")); - out.write(("").getBytes()); + out.write(("
").getBytes()); writeFooter(out); } }