]> source.dussan.org Git - jgit.git/commitdiff
dumb HTTP: Clarify AsIsFilter by introducing req and res locals 78/49278/1
authorJonathan Nieder <jrn@google.com>
Tue, 2 Jun 2015 23:14:19 +0000 (16:14 -0700)
committerJonathan Nieder <jrn@google.com>
Tue, 2 Jun 2015 23:54:08 +0000 (16:54 -0700)
No functional change.

Change-Id: I945ba18879c360f433e026aa125ef3f9f6a75793
Signed-off-by: Jonathan Nieder <jrn@google.com>
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java

index b2250e3ef320a37c74eb88f7ab9b2164d10b663f..e8d809659b46144a766a2f7e87ac3776a0320947 100644 (file)
@@ -80,14 +80,16 @@ class AsIsFileFilter implements Filter {
 
        public void doFilter(ServletRequest request, ServletResponse response,
                        FilterChain chain) throws IOException, ServletException {
+               HttpServletRequest req = (HttpServletRequest) request;
+               HttpServletResponse res = (HttpServletResponse) response;
                try {
                        final Repository db = getRepository(request);
-                       asIs.access((HttpServletRequest) request, db);
+                       asIs.access(req, db);
                        chain.doFilter(request, response);
                } catch (ServiceNotAuthorizedException e) {
-                       ((HttpServletResponse) response).sendError(SC_UNAUTHORIZED);
+                       res.sendError(SC_UNAUTHORIZED);
                } catch (ServiceNotEnabledException e) {
-                       ((HttpServletResponse) response).sendError(SC_FORBIDDEN);
+                       res.sendError(SC_FORBIDDEN);
                }
        }
 }