WebSession: Prevent NPE in GitSmartHttpTools.isGitClient()
ContinuingHttpServletRequest doesn't have request URI. That cause public static boolean isInfoRefs(HttpServletRequest req) { return req.getRequestURI().endsWith(INFO_REFS_PATH) && VALID_SERVICES.contains(req.getParameter("service")); } to throw NPE. More robust implementation of isInfoRefs() could check for req.getRequestURI() != null or swap the conditions. Bug was filled against JGit project: [1]. [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=435404 Change-Id: Iac85505720496b411814a6d050a7612d507bf3a6
This commit is contained in:

committed by
David Ostrovsky

parent
ba75ccf8cd
commit
f8578183f3
@@ -68,7 +68,8 @@ public abstract class CacheBasedWebSession implements WebSession {
|
||||
this.anonymousProvider = anonymousProvider;
|
||||
this.identified = identified;
|
||||
|
||||
if (!GitSmartHttpTools.isGitClient(request)) {
|
||||
if (request.getRequestURI() == null
|
||||
|| !GitSmartHttpTools.isGitClient(request)) {
|
||||
String cookie = readCookie();
|
||||
if (cookie != null) {
|
||||
key = new Key(cookie);
|
||||
|
Reference in New Issue
Block a user