From 914b0e4f8a0742970a406329027cb8c6aad37920 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 3 Nov 2022 09:04:26 -0700 Subject: [PATCH] Set NoCacheFilter for js-plugins --- .../main/java/io/deephaven/server/jetty/JsPlugins.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/jetty/src/main/java/io/deephaven/server/jetty/JsPlugins.java b/server/jetty/src/main/java/io/deephaven/server/jetty/JsPlugins.java index ba4d7c99733..8cb608ab485 100644 --- a/server/jetty/src/main/java/io/deephaven/server/jetty/JsPlugins.java +++ b/server/jetty/src/main/java/io/deephaven/server/jetty/JsPlugins.java @@ -1,12 +1,17 @@ package io.deephaven.server.jetty; import io.deephaven.configuration.Configuration; +import jakarta.servlet.DispatcherType; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; +import java.util.EnumSet; + class JsPlugins { + public static final String JS_PLUGINS_PATH_SPEC = "/js-plugins/*"; + public static void maybeAdd(ServletContextHandler context) { // Note: this would probably be better to live in JettyConfig - but until we establish more formal expectations // for js plugin configuration and workflows, we'll keep this here. @@ -15,7 +20,8 @@ public static void maybeAdd(ServletContextHandler context) { if (resourceBase == null) { return; } - context.addServlet(createServlet("js-plugins", resourceBase), "/js-plugins/*"); + context.addFilter(NoCacheFilter.class, JS_PLUGINS_PATH_SPEC, EnumSet.noneOf(DispatcherType.class)); + context.addServlet(createServlet("js-plugins", resourceBase), JS_PLUGINS_PATH_SPEC); } private static ServletHolder createServlet(String name, String resourceBase) {