diff --git a/src/marauroa/server/net/web/DetaillessErrorReportValve.java b/src/marauroa/server/net/web/DetaillessErrorReportValve.java new file mode 100644 index 00000000..d0952e02 --- /dev/null +++ b/src/marauroa/server/net/web/DetaillessErrorReportValve.java @@ -0,0 +1,12 @@ +package marauroa.server.net.web; + +import org.apache.catalina.valves.ErrorReportValve; + +public class DetaillessErrorReportValve extends ErrorReportValve { + + public DetaillessErrorReportValve() { + super(); + setShowReport(false); + setShowServerInfo(false); + } +} diff --git a/src/marauroa/server/net/web/WebSocketServer.java b/src/marauroa/server/net/web/WebSocketServer.java index dc59a9f6..31c7c02e 100644 --- a/src/marauroa/server/net/web/WebSocketServer.java +++ b/src/marauroa/server/net/web/WebSocketServer.java @@ -17,6 +17,7 @@ import org.apache.catalina.Context; import org.apache.catalina.connector.Connector; +import org.apache.catalina.core.StandardHost; import org.apache.catalina.startup.ContextConfig; import org.apache.catalina.startup.Tomcat; import org.apache.tomcat.util.scan.StandardJarScanner; @@ -71,6 +72,9 @@ public static void startWebSocketServer() throws Exception { connector.setProperty("address", host); tomcat.setConnector(connector); + StandardHost standardHost = (StandardHost) tomcat.getHost(); + standardHost.setErrorReportValveClass("marauroa.server.net.web.DetaillessErrorReportValve"); + Context context = tomcat.addContext("", createTemporaryFolder()); StandardJarScanner scan = (StandardJarScanner) context.getJarScanner(); scan.setScanClassPath(true);