Fix issue where static pages where not served
Static pages like /static/ or /Documentation/ should not need login.
This fixes issue where the header logo is not visible on login page
and documentation link is not visible in polygerrit.
Change-Id: Id670e19dcc15e1b2c8e940f410e7291351f9129f
diff --git a/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java b/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java
index 9dd7e54..ec70e99 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/loginredirect/LoginRedirectFilter.java
@@ -40,7 +40,11 @@
if (!httpReq.getContextPath().isEmpty()) {
path = path.substring(httpReq.getContextPath().length());
}
- if (path.startsWith("/login") || path.startsWith("/a/") || sessionProvider.get().isSignedIn()) {
+ if (path.startsWith("/login") ||
+ path.startsWith("/a/") ||
+ path.startsWith("/Documentation/") ||
+ path.startsWith("/static/") ||
+ sessionProvider.get().isSignedIn()) {
chain.doFilter(request, response);
} else {
((HttpServletResponse) response).sendRedirect(getLoginRedirectUrl(httpReq));