@Override public void handle(String pathInContext, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.addHeader("Access-Control-Allow-Origin", "*"); if (request.getHeader("Access-Control-Request-Method") != null && "OPTIONS" .equals(request.getMethod())) { response.addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE"); response.addHeader("Access-Control-Allow-Headers", "X-Requested-With,Origin,Content-Type, Accept"); } super.handle(pathInContext, baseRequest, request, response); } };
@Override public void handle( String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response ) throws IOException, ServletException { String method = request.getMethod(); super.handle( target, baseRequest, request, response ); handlerRequestResponses.add( new HandlerRequestResponse( method, ( (Response) response ).getStatus(), request.getRequestURI() ) ); } }
@Override public void handle( String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response ) throws IOException, ServletException { String method = request.getMethod(); super.handle( target, baseRequest, request, response ); handlerRequestResponses.add( new HandlerRequestResponse( method, ( (Response) response ).getStatus(), request.getRequestURI() ) ); } }
@Override public void handle(String pathInContext, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { baseRequest.setAuthentication(RemoteUserUtils.ensureRemoteUserSetIfIncluded(baseRequest)); super.handle(pathInContext, baseRequest, request, response); //To change body of overridden methods use File | Settings | File Templates. } }
@Override public void handle(String pathInContext, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { baseRequest.setAuthentication(RemoteUserUtils.ensureRemoteUserSetIfIncluded(baseRequest)); super.handle(pathInContext, baseRequest, request, response); //To change body of overridden methods use File | Settings | File Templates. } }
@Override public void handle(String arg0, Request arg1, HttpServletRequest arg2, HttpServletResponse arg3) throws IOException, ServletException { System.err.println("request in security handler"); System.err.println("Authorization: " + arg2.getHeader("Authorization")); System.err.println("RequestUri: " + arg2.getRequestURI()); super.handle(arg0, arg1, arg2, arg3); } };
@Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { try { boolean authenticated = true; if (user != null) { authenticated = new ProxyAuth(user, password).execute(request, response, null); } if (authenticated) { super.handle(target, baseRequest, request, response); } else { baseRequest.setHandled(true); } } catch (Exception e) { throw new ServletException(e.getMessage(), e); } }
@Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { try { boolean authenticated = true; if (user != null) { authenticated = new ProxyAuth(user, password).execute(request, response, null); } if (authenticated) { super.handle(target, baseRequest, request, response); } else { baseRequest.setHandled(true); } } catch (Exception e) { throw new ServletException(e.getMessage(), e); } } }