google / guice

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google.
https://github.com/google/guice
Apache License 2.0
12.48k stars 1.67k forks source link

Bug in anonymous sub class of HttpServletRequestWrapper in doService()? #1017

Open thomasmey opened 8 years ago

thomasmey commented 8 years ago

HI,

I thinks there is maybe a bug in the method getPathInfo() which calls getServletPath(). The problem is as we don't have any real Servlets here and only one real filter is installed in the servlet container, so getServletPath() will always return an empty string according to the documentation ( https://docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletRequest.html#getServletPath-- ) because eveything wll be matched against /*

But guice-servlet users like expect the getServletPath to return something different as this call is made in computePath(): path = patternMatcher.extractPath(servletPath);

This call makes only sense when not an empty string is returned.

This broken behaviour makes it currently impossbile to run gerrit on any other servlet container than jetty 9.2 I guess.

thomasmey commented 8 years ago

This patch makes gerrit work correctly in IBM's WLP which always returns "" in getServletPath() according to the specification:

fix-servlet-path-for-gerrit.txt

thomasmey commented 8 years ago

Hi, what do I need to do get this merged? Can I assist somehow?