]> source.dussan.org Git - jgit.git/commit
Extract path info from requests without decoding 25/37325/7
authorDavid Pletcher <dpletcher@google.com>
Sat, 1 Nov 2014 21:34:18 +0000 (14:34 -0700)
committerDavid Pletcher <dpletcher@google.com>
Wed, 10 Dec 2014 05:06:21 +0000 (21:06 -0800)
commit19f869996f27adf59ec507e5f565d8b5619576f3
treeb6ca18d6abbfb85af7d1d4f9b8e03a9f6f749441
parentc9a5fdb3cd92d5774aa7041b9fc9fc579dc26edc
Extract path info from requests without decoding

Gitiles malfunctions in conjunction with jgit and guice
because of a recent Guice bug fix. Work around the problem
by parsing the URI directly, bypassing the unescaping
performed by the getPathInfo method.

This rest of this message is copied from
https://gerrit-review.googlesource.com/#/c/60820/ :

The fix for Guice issue #745[1] causes getPathInfo() within the
GuiceFilter to return decoded values, eliminating the difference
between "foo/bar" and "foo%2Fbar". This is in spec with the servlet
standard, whose javadoc for getPathInfo[2] states that the return
value be "decoded by the web container".

Work around this by extracting the path part directly from the request
URI, which is unmodified by the container. This is copying the Guice
behavior prior to the bugfix.

[1] https://github.com/google/guice/issues/745
[2] http://docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletRequest.html#getPathInfo()

Change-Id: I7fdb291bda377dab6160599ee537962d5f60f1e8
Signed-off-by: David Pletcher <dpletcher@google.com>
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/RegexPipeline.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/SuffixPipeline.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/server/ServletUtilsTest.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RegexPipelineTest.java