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
This commit is contained in:
Sven Selberg 2017-10-11 11:03:19 +02:00
parent 4ff7bd67e5
commit d57189eb4f

View File

@ -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);
}
});
}