From 6e8f71bcd37cd4871f7acf0dc5c1bf06e07f99f7 Mon Sep 17 00:00:00 2001 From: Shanmukha Kota Date: Fri, 12 Apr 2024 14:40:21 -0500 Subject: [PATCH] HBASE-28514: HBase web console automatically listing directories in static/css --- .../apache/hadoop/hbase/http/HttpServer.java | 2 +- .../resources/hbase-webapps/static/index.html | 20 +++++++++++++++++++ .../org/eclipse/jetty/webapp/webdefault.xml | 4 ++-- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 hbase-server/src/main/resources/hbase-webapps/static/index.html diff --git a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java index d5af8df1c7fd..41644d159f48 100644 --- a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java +++ b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java @@ -770,7 +770,7 @@ protected void addDefaultApps(ContextHandlerCollection parent, final String appD // set up the context for "/static/*" ServletContextHandler staticContext = new ServletContextHandler(parent, "/static"); staticContext.setResourceBase(appDir + "/static"); - staticContext.addServlet(DefaultServlet.class, "/*"); + staticContext.addServlet(AdminAuthorizedServlet.class, "/*"); staticContext.setDisplayName("static"); setContextAttributes(staticContext, conf); defaultContexts.put(staticContext, true); diff --git a/hbase-server/src/main/resources/hbase-webapps/static/index.html b/hbase-server/src/main/resources/hbase-webapps/static/index.html new file mode 100644 index 000000000000..0f05414a219b --- /dev/null +++ b/hbase-server/src/main/resources/hbase-webapps/static/index.html @@ -0,0 +1,20 @@ + + diff --git a/hbase-shaded/hbase-shaded-testing-util/src/main/resources/org/apache/hadoop/hbase/shaded/org/eclipse/jetty/webapp/webdefault.xml b/hbase-shaded/hbase-shaded-testing-util/src/main/resources/org/apache/hadoop/hbase/shaded/org/eclipse/jetty/webapp/webdefault.xml index 8f10b517eb55..f76945237873 100644 --- a/hbase-shaded/hbase-shaded-testing-util/src/main/resources/org/apache/hadoop/hbase/shaded/org/eclipse/jetty/webapp/webdefault.xml +++ b/hbase-shaded/hbase-shaded-testing-util/src/main/resources/org/apache/hadoop/hbase/shaded/org/eclipse/jetty/webapp/webdefault.xml @@ -163,11 +163,11 @@ limitations under the License. welcomeServlets - false + true redirectWelcome - false + true maxCacheSize