From 761e61f1ede1ec3ddeca9b7a6f959f43bb6ee8bb Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 2 Jun 2015 16:14:19 -0700 Subject: dumb HTTP: Clarify AsIsFilter by introducing req and res locals No functional change. Change-Id: I945ba18879c360f433e026aa125ef3f9f6a75793 Signed-off-by: Jonathan Nieder --- .../src/org/eclipse/jgit/http/server/AsIsFileFilter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'org.eclipse.jgit.http.server/src') diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java index b2250e3ef3..e8d809659b 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java @@ -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); } } } -- cgit v1.2.3