From d5272f50f187763fa24e70ec9be47fba089fed63 Mon Sep 17 00:00:00 2001 From: Heng Qin Date: Tue, 19 Dec 2023 15:35:26 +0800 Subject: [PATCH] fix --- docs/security.md | 4 ++-- .../java/com/datastrato/gravitino/server/web/JettyServer.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/security.md b/docs/security.md index 3b21848c245..8b78796e6e0 100644 --- a/docs/security.md +++ b/docs/security.md @@ -297,12 +297,12 @@ If you want to use a cross-origin filter for the Gravitino server, you can follo ```shell wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-servlets/9.4.51.v20230217/jetty-servlets-9.4.51.v20230217.jar -cp jetty-servlets-9.4.51.v20230217.jar /lib +cp jetty-servlets-9.4.51.v20230217.jar /libs ``` You can refer to the [Configurations](gravitino-server-config.md) and append the configurations to the conf/gravitino.conf. ```text -gravitino.server.webserver.customFilter=org.eclipse.jetty.servlets.CrossOriginFilter +gravitino.server.webserver.customFilters=org.eclipse.jetty.servlets.CrossOriginFilter gravitino.server.webserver.org.eclipse.jetty.servlets.CrossOriginFilter.param.allowedOrigins=* ``` \ No newline at end of file diff --git a/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServer.java b/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServer.java index db9075479c7..10f89c95c9a 100644 --- a/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServer.java +++ b/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServer.java @@ -437,6 +437,9 @@ public ThreadPool getThreadPool() { public void addCustomFilters(String pathSpec) { for (String filterName : serverConfig.getCustomFilters()) { + if (StringUtils.isBlank(filterName)) { + continue; + } FilterHolder filterHolder = new FilterHolder(); filterHolder.setClassName(filterName); for (Map.Entry entry :