This is an automated email from the ASF dual-hosted git repository.

aonishuk pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new a00a76d  AMBARI-25390. Disable indexing in /resources endpoint and 
sub-directories (aonishuk)
a00a76d is described below

commit a00a76dd33343d54f8e2f9e504f5cea80e48c0d1
Author: Andrew Onishuk <aonis...@hortonworks.com>
AuthorDate: Fri Oct 4 14:18:36 2019 +0300

    AMBARI-25390. Disable indexing in /resources endpoint and sub-directories 
(aonishuk)
---
 .../apache/ambari/server/controller/AmbariServer.java   |  1 +
 ambari-server/src/main/resources/index.html             | 17 -----------------
 2 files changed, 1 insertion(+), 17 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index bd99527..b7f44ff 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -511,6 +511,7 @@ public class AmbariServer {
       File resourcesDirectory = new File(configs.getResourceDirPath());
       ServletHolder resources = new ServletHolder(DefaultServlet.class);
       resources.setInitParameter("resourceBase", 
resourcesDirectory.getParent());
+      resources.setInitParameter("dirAllowed", "false");
       root.addServlet(resources, "/resources/*");
       resources.setInitOrder(5);
 
diff --git a/ambari-server/src/main/resources/index.html 
b/ambari-server/src/main/resources/index.html
deleted file mode 100644
index 734b094..0000000
--- a/ambari-server/src/main/resources/index.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
--->

Reply via email to