diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
index 1916b415ac..b729b659ba 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
@@ -3,8 +3,10 @@
*/
package net.i2p.i2ptunnel;
+import java.io.ByteArrayOutputStream;
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -15,6 +17,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Properties;
import java.util.StringTokenizer;
@@ -55,6 +58,10 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
private HashMap addressHelpers = new HashMap();
+ /**
+ * These are backups if the xxx.ht error page is missing.
+ */
+
private final static byte[] ERR_REQUEST_DENIED =
("HTTP/1.1 403 Access Denied\r\n"+
"Content-Type: text/html; charset=iso-8859-1\r\n"+
@@ -77,6 +84,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
"Could not find the following Destination:
"+ "You can resolve the conflict by considering which key you trust, "+ "and either discarding the addresshelper link, "+ "discarding the host entry from your host database, "+ - "or naming one of them differently.
") + "or naming one of them differently.") .getBytes(); private final static byte[] ERR_BAD_PROTOCOL = @@ -376,22 +385,16 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable // Did addresshelper key conflict? if (ahelperConflict) { - String str; - byte[] header; - str = FileUtil.readTextFile((new File(_errorDir, "ahelper-conflict-header.ht")).getAbsolutePath(), 100, true); - if (str != null) header = str.getBytes(); - else header = ERR_AHELPER_CONFLICT; if (out != null) { + // Fixme untranslated long alias = I2PAppContext.getGlobalContext().random().nextLong(); String trustedURL = protocol + uriPath + urlEncoding; String conflictURL = protocol + alias + ".i2p/?" + initialFragments; + 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 link by temporarily giving it a random alias, click here.
").getBytes()); - out.write("