From 3286926d2ec11445f76cd170e4c2fcff597a0754 Mon Sep 17 00:00:00 2001
From: Fabrice Bacchella <fbacchella@spamcop.net>
Date: Tue, 26 May 2015 04:48:40 -0400
Subject: [PATCH] Two slight improvement for custom UserService: - try userRealm as a file only if class is not found, other exeptions are real error - log userService only after setup, for better logging, as it can use gitblit.properties for custom .toString
---
src/main/java/com/gitblit/guice/WebModule.java | 31 ++++++++++++-------------------
1 files changed, 12 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..c6172c3 100644
--- a/src/main/java/com/gitblit/guice/WebModule.java
+++ b/src/main/java/com/gitblit/guice/WebModule.java
@@ -53,11 +53,6 @@
public class WebModule extends ServletModule {
final static String ALL = "/*";
- private boolean isGO;
-
- public WebModule(boolean isGO) {
- this.isGO=isGO;
- }
@Override
protected void configureServlets() {
@@ -75,20 +70,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