diff options
author | Jonathan Nieder <jrn@google.com> | 2015-06-02 16:14:19 -0700 |
---|---|---|
committer | Jonathan Nieder <jrn@google.com> | 2015-06-02 16:54:08 -0700 |
commit | 761e61f1ede1ec3ddeca9b7a6f959f43bb6ee8bb (patch) | |
tree | 4e545e49ed1f1e48c7cf95f80b6a943c7959fd9f /org.eclipse.jgit.http.server/src | |
parent | 54b195ad3eeed88f20774f2aa1a5d6b19f59b0d7 (diff) | |
download | jgit-761e61f1ede1ec3ddeca9b7a6f959f43bb6ee8bb.tar.gz jgit-761e61f1ede1ec3ddeca9b7a6f959f43bb6ee8bb.zip |
dumb HTTP: Clarify AsIsFilter by introducing req and res locals
No functional change.
Change-Id: I945ba18879c360f433e026aa125ef3f9f6a75793
Signed-off-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'org.eclipse.jgit.http.server/src')
-rw-r--r-- | org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java | 8 |
1 files changed, 5 insertions, 3 deletions
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); } } } |