From 85c998e5009453fe91e8b5861ab03783d3708bbd Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sun, 3 Nov 2013 15:04:37 +0000
Subject: [PATCH] HTTP proxy: Fix addressbook name on redirect page

---
 .../i2p/i2ptunnel/localServer/LocalHTTPServer.java  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java
index 77848cf1ba..a61082fbfe 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java
@@ -183,6 +183,15 @@ public abstract class LocalHTTPServer {
 
     /** @since 0.8.7 */
     private static void writeRedirectPage(OutputStream out, boolean success, String host, String book, String url) throws IOException {
+        String tbook;
+        if ("hosts.txt".equals(book))
+            tbook = _("router");
+        else if ("userhosts.txt".equals(book))
+            tbook = _("master");
+        else if ("privatehosts.txt".equals(book))
+            tbook = _("private");
+        else
+            tbook = book;
         out.write(("HTTP/1.1 200 OK\r\n"+
                   "Content-Type: text/html; charset=UTF-8\r\n"+
                   "\r\n"+
@@ -199,8 +208,8 @@ public abstract class LocalHTTPServer {
                   "<div class=warning id=warning>\n" +
                   "<h3>" +
                   (success ?
-                           _("Saved {0} to the {1} addressbook, redirecting now.", host, book) :
-                           _("Failed to save {0} to the {1} addressbook, redirecting now.", host, book)) +
+                           _("Saved {0} to the {1} addressbook, redirecting now.", host, tbook) :
+                           _("Failed to save {0} to the {1} addressbook, redirecting now.", host, tbook)) +
                   "</h3>\n<p><a href=\"" + url + "\">" +
                   _("Click here if you are not redirected automatically.") +
                   "</a></p></div>").getBytes("UTF-8"));
-- 
GitLab