From dcb9d381145dbc95353a159620f54a69a015c673 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Fri, 31 Dec 2010 13:13:26 +0000
Subject: [PATCH]       - Make theme files and history.txt return 403 on error,
         not 500, to avoid the new error page

---
 apps/routerconsole/jsp/viewhistory.jsp | 6 +++++-
 apps/routerconsole/jsp/viewtheme.jsp   | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/apps/routerconsole/jsp/viewhistory.jsp b/apps/routerconsole/jsp/viewhistory.jsp
index 6268abd5a2..14ee0bbffa 100644
--- a/apps/routerconsole/jsp/viewhistory.jsp
+++ b/apps/routerconsole/jsp/viewhistory.jsp
@@ -8,5 +8,9 @@
  */
 response.setContentType("text/plain");
 String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath();
-net.i2p.util.FileUtil.readFile("history.txt", base, response.getOutputStream());
+try {
+    net.i2p.util.FileUtil.readFile("history.txt", base, response.getOutputStream());
+} catch (java.io.IOException ioe) {
+    response.sendError(403, ioe.toString());
+}
 %>
\ No newline at end of file
diff --git a/apps/routerconsole/jsp/viewtheme.jsp b/apps/routerconsole/jsp/viewtheme.jsp
index c095cc54e9..723b0ec327 100644
--- a/apps/routerconsole/jsp/viewtheme.jsp
+++ b/apps/routerconsole/jsp/viewtheme.jsp
@@ -44,5 +44,9 @@ if (themePath != null)
 else
     base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath() +
               java.io.File.separatorChar + "docs";
-net.i2p.util.FileUtil.readFile(uri, base, response.getOutputStream());
+try {
+    net.i2p.util.FileUtil.readFile(uri, base, response.getOutputStream());
+} catch (java.io.IOException ioe) {
+    response.sendError(403, ioe.toString());
+}
 %>
\ No newline at end of file
-- 
GitLab