From 667a6adddb24b2a0a32a7ed6887cf5dfbe60f063 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Thu, 26 Dec 2013 23:59:04 +0100 Subject: [PATCH] - use default files from yacy.init property "defaultFiles" if no jetty-configuration is given for default files. - fix a problem with default paths if no path is given (i.e. http://localhost:8090 instead of http://localhost:8090/). Without this patch the path was resolved automatically to http://localhost:8090// --- source/net/yacy/http/servlets/YaCyDefaultServlet.java | 4 ++-- source/net/yacy/server/http/HTTPDFileHandler.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/net/yacy/http/servlets/YaCyDefaultServlet.java b/source/net/yacy/http/servlets/YaCyDefaultServlet.java index fd7172ad3..bb6ddd146 100644 --- a/source/net/yacy/http/servlets/YaCyDefaultServlet.java +++ b/source/net/yacy/http/servlets/YaCyDefaultServlet.java @@ -142,7 +142,7 @@ public class YaCyDefaultServlet extends HttpServlet { _mimeTypes = new MimeTypes(); String tmpstr = this.getServletContext().getInitParameter("welcomeFile"); if (tmpstr == null) { - _welcomes = new String[]{"index.html", "welcome.html"}; // set a default welcome file name + _welcomes = HTTPDFileHandler.defaultFiles; } else { _welcomes = new String[]{tmpstr,"index.html"}; } @@ -305,7 +305,7 @@ public class YaCyDefaultServlet extends HttpServlet { } else { // resource is directory String welcome; - if (!endsWithSlash || (pathInContext.length() == 1)) { + if (!endsWithSlash) { StringBuffer buf = request.getRequestURL(); synchronized (buf) { int param = buf.lastIndexOf(";"); diff --git a/source/net/yacy/server/http/HTTPDFileHandler.java b/source/net/yacy/server/http/HTTPDFileHandler.java index 2241ec56a..8652f37d4 100644 --- a/source/net/yacy/server/http/HTTPDFileHandler.java +++ b/source/net/yacy/server/http/HTTPDFileHandler.java @@ -73,7 +73,7 @@ public final class HTTPDFileHandler { private static File htRootPath = null; public static File htDocsPath = null; - private static String[] defaultFiles = null; + public static String[] defaultFiles = null; private static File htDefaultPath = null; private static File htLocalePath = null; public static String indexForward = "";