Fix getRequestURI for wrapped http requests served via plugins.

When a request is served with a HttpServlet from a plugin and the URL
contains the authentication prefix "/a/" then the getRequestURI() was
including that prefix into its value. However, the getContextPath() from
the same request doesn't include the leading "/a/". This confused the
Guice doFilter method and such a request was rejected with NOT_FOUND
before even reaching the HttpServlet from the plugin.

In the wrapped http request remove the leading "/a/" also from the
getRequestURI to keep it consistent with the getContextPath.

This also fixes the existing getServletPath method which was returning
a wrong value when the request URL contained "/a/" prefix.

Change-Id: I842a2b8d0425a570cbef0b8b8bd08361cc8a603f
1 file changed