From d57189eb4f0dd99f4fd8c54006716e865b8722df Mon Sep 17 00:00:00 2001 From: Sven Selberg Date: Wed, 11 Oct 2017 11:03:19 +0200 Subject: [PATCH] Redirect polygerrit urls with context to GWTUI When CanonicalWebURL contains a context like 'gerrit'. https://a-host/gerrit the context was not taken into consideration when redirecting polygerrit urls to GWT urls. pg-uri: /gerrit/c/123/ context + '#' + pg-uri = /gerrit/#/gerrit/c/123 Strip context from pg-uri before transforming it to GWT url. Change-Id: I7aa10c53a40c21c3240f227d015827ca38e19da8 --- .../src/main/java/com/google/gerrit/httpd/UrlModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java index 8dfe38cea0..409e9785eb 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/UrlModule.java @@ -137,7 +137,7 @@ class UrlModule extends ServletModule { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { - toGerrit(req.getRequestURI(), req, rsp); + toGerrit(req.getRequestURI().substring(req.getContextPath().length()), req, rsp); } }); }