From 7be48d8d14c74dfb10ba3d71f12a78505daf29a6 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gmail.com>
Date: Wed, 30 Sep 2015 12:00:35 -0400
Subject: [PATCH] Merge pull request #929 from willyann/develop

---
 src/main/java/com/gitblit/guice/WebModule.java |   36 +++++++++++++++++-------------------
 1 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/src/main/java/com/gitblit/guice/WebModule.java b/src/main/java/com/gitblit/guice/WebModule.java
index 4a0cfcd..a406270 100644
--- a/src/main/java/com/gitblit/guice/WebModule.java
+++ b/src/main/java/com/gitblit/guice/WebModule.java
@@ -18,6 +18,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import com.gitblit.AvatarGenerator;
 import com.gitblit.Constants;
 import com.gitblit.servlet.AccessDeniedServlet;
 import com.gitblit.servlet.BranchGraphServlet;
@@ -53,14 +54,13 @@
 public class WebModule extends ServletModule {
 
 	final static String ALL = "/*";
-	private boolean isGO;
-
-	public WebModule(boolean isGO) {
-		this.isGO=isGO;
-	}
 
 	@Override
 	protected void configureServlets() {
+
+		// bind web component providers
+		bind(AvatarGenerator.class).toProvider(AvatarGeneratorProvider.class);
+
 		// servlets
 		serve(fuzzy(Constants.R_PATH), fuzzy(Constants.GIT_PATH)).with(GitServlet.class);
 		serve(fuzzy(Constants.RAW_PATH)).with(RawServlet.class);
@@ -75,20 +75,18 @@
 		serve(Constants.PT_PATH).with(PtServlet.class);
 		serve("/robots.txt").with(RobotsTxtServlet.class);
 		serve("/logo.png").with(LogoServlet.class);
-		if(isGO)
-		{
-			/* Prevent accidental access to 'resources' such as GitBlit java classes
-			 *
-			 * In the GO setup the JAR containing the application and the WAR injected
-			 * into Jetty are the same file. However Jetty expects to serve the entire WAR
-			 * contents, except the WEB-INF folder. Thus, all java binary classes in the
-			 * JAR are served by default as is they were legitimate resources.
-			 *
-			 * The below servlet mappings prevent that behavior
-			 */
-			serve(fuzzy("/com/")).with(AccessDeniedServlet.class);
-			serve(fuzzy("/org/")).with(AccessDeniedServlet.class);
-		}
+
+		/* Prevent accidental access to 'resources' such as GitBlit java classes
+		 *
+		 * In the GO setup the JAR containing the application and the WAR injected
+		 * into Jetty are the same file. However Jetty expects to serve the entire WAR
+		 * contents, except the WEB-INF folder. Thus, all java binary classes in the
+		 * JAR are served by default as is they were legitimate resources.
+		 *
+		 * The below servlet mappings prevent that behavior
+		 */
+		serve(fuzzy("/com/")).with(AccessDeniedServlet.class);
+
 		// global filters
 		filter(ALL).through(ProxyFilter.class);
 		filter(ALL).through(EnforceAuthenticationFilter.class);

--
Gitblit v1.9.1