Browse Source

dumb HTTP: Clarify AsIsFilter by introducing req and res locals

No functional change.

Change-Id: I945ba18879c360f433e026aa125ef3f9f6a75793
Signed-off-by: Jonathan Nieder <jrn@google.com>
stable-4.1
Jonathan Nieder 10 years ago
parent
commit
761e61f1ed
  1. 8
      org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/AsIsFileFilter.java

8
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, public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException { FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse res = (HttpServletResponse) response;
try { try {
final Repository db = getRepository(request); final Repository db = getRepository(request);
asIs.access((HttpServletRequest) request, db); asIs.access(req, db);
chain.doFilter(request, response); chain.doFilter(request, response);
} catch (ServiceNotAuthorizedException e) { } catch (ServiceNotAuthorizedException e) {
((HttpServletResponse) response).sendError(SC_UNAUTHORIZED); res.sendError(SC_UNAUTHORIZED);
} catch (ServiceNotEnabledException e) { } catch (ServiceNotEnabledException e) {
((HttpServletResponse) response).sendError(SC_FORBIDDEN); res.sendError(SC_FORBIDDEN);
} }
} }
} }

Loading…
Cancel
Save