diff --git a/java/com/google/gerrit/httpd/raw/StaticModule.java b/java/com/google/gerrit/httpd/raw/StaticModule.java index fc6762bc9b..98fbdfe8f4 100644 --- a/java/com/google/gerrit/httpd/raw/StaticModule.java +++ b/java/com/google/gerrit/httpd/raw/StaticModule.java @@ -247,8 +247,8 @@ public class StaticModule extends ServletModule { public void configureServlets() { for (String p : POLYGERRIT_INDEX_PATHS) { // Skip XsrfCookieFilter for /, since that is already done in the GWT UI - // path (UrlModule). - if (!p.equals("/")) { + // path (UrlModule) if it is enabled. + if (!(p.equals("/") && options.enableGwtUi())) { filter(p).through(XsrfCookieFilter.class); } }