diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java index 463f2d6c48..99a67d8d2e 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java @@ -624,8 +624,16 @@ class HttpPluginServlet extends HttpServlet @Override public String getServletPath() { - return ((HttpServletRequest) getRequest()).getRequestURI().substring( - contextPath.length()); + return getRequestURI().substring(contextPath.length()); + } + + @Override + public String getRequestURI() { + String uri = super.getRequestURI(); + if (uri.startsWith("/a/")) { + uri = uri.substring(2); + } + return uri; } } }