Skip to content

Commit

Permalink
Set NoCacheFilter for js-plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
devinrsmith committed Nov 3, 2022
1 parent 5572140 commit 914b0e4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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) {
Expand Down

0 comments on commit 914b0e4

Please sign in to comment.