diff options
author | Eddy Young <jeyoung@priscimon.com> | 2015-05-22 08:47:09 +0100 |
---|---|---|
committer | Eddy Young <jeyoung@priscimon.com> | 2015-05-22 08:47:09 +0100 |
commit | 410c92f5c71c93cd2b4b0a1d9ee4067c34b80c66 (patch) | |
tree | 33964e7a85c79c868660d845886b1eb8f673f549 /src/main/java/com/gitblit/guice/WebModule.java | |
parent | aca08ed7e7b42f233a8a91d8059f0beb50d6983d (diff) | |
parent | c36bfeced34a34638e363461cea0804da6dbc5c3 (diff) | |
download | gitblit-410c92f5c71c93cd2b4b0a1d9ee4067c34b80c66.tar.gz gitblit-410c92f5c71c93cd2b4b0a1d9ee4067c34b80c66.zip |
Merge branch 'develop' into ticket-57_develop
Diffstat (limited to 'src/main/java/com/gitblit/guice/WebModule.java')
-rw-r--r-- | src/main/java/com/gitblit/guice/WebModule.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/guice/WebModule.java b/src/main/java/com/gitblit/guice/WebModule.java index 5b569182..c6172c3d 100644 --- a/src/main/java/com/gitblit/guice/WebModule.java +++ b/src/main/java/com/gitblit/guice/WebModule.java @@ -19,6 +19,7 @@ import java.util.HashMap; import java.util.Map; import com.gitblit.Constants; +import com.gitblit.servlet.AccessDeniedServlet; import com.gitblit.servlet.BranchGraphServlet; import com.gitblit.servlet.DownloadZipFilter; import com.gitblit.servlet.DownloadZipServlet; @@ -70,6 +71,17 @@ public class WebModule extends ServletModule { serve("/robots.txt").with(RobotsTxtServlet.class); serve("/logo.png").with(LogoServlet.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); |