From 0dccce1b5cffce03124f001ae03b66962f36fee6 Mon Sep 17 00:00:00 2001
From: Trygve Laugstøl <trygvis@inamo.no>
Date: Mon, 10 Oct 2011 10:49:29 -0400
Subject: [PATCH] o Adding missing properties to gitblit.properties for adjusting the context path.

---
 src/com/gitblit/AccessRestrictionFilter.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/com/gitblit/AccessRestrictionFilter.java b/src/com/gitblit/AccessRestrictionFilter.java
index 6ec70db..25adc52 100644
--- a/src/com/gitblit/AccessRestrictionFilter.java
+++ b/src/com/gitblit/AccessRestrictionFilter.java
@@ -130,14 +130,15 @@
 
 		AccessRestrictionRequest accessRequest = new AccessRestrictionRequest(httpRequest);
 
-		String url = httpRequest.getRequestURI().substring(httpRequest.getServletPath().length());
+		String servletUrl = httpRequest.getContextPath() + httpRequest.getServletPath();
+		String url = httpRequest.getRequestURI().substring(servletUrl.length());
 		String params = httpRequest.getQueryString();
 		if (url.length() > 0 && url.charAt(0) == '/') {
 			url = url.substring(1);
 		}
 		String fullUrl = url + (StringUtils.isEmpty(params) ? "" : ("?" + params));
 
-		String repository = extractRepositoryName(url);
+		String repository = extractRepositoryName(fullUrl);
 
 		// Determine if the request URL is restricted
 		String fullSuffix = fullUrl.substring(repository.length());

--
Gitblit v1.9.1