Mercurial Hosting > luan
diff src/luan/modules/http/AuthenticationHandler.java @ 1000:32d4b569567c
simplify handle()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 19 Oct 2016 04:22:51 -0600 |
parents | b3176fd168bf |
children | 0d884377e923 |
line wrap: on
line diff
--- a/src/luan/modules/http/AuthenticationHandler.java Wed Oct 19 00:59:46 2016 -0600 +++ b/src/luan/modules/http/AuthenticationHandler.java Wed Oct 19 04:22:51 2016 -0600 @@ -2,7 +2,6 @@ import java.io.IOException; import java.util.Base64; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.AbstractHandler; @@ -20,7 +19,8 @@ this.password = password; } - public void handle(String target,Request baseRequest,HttpServletRequest request,HttpServletResponse response) + @Override + public void handle(String target,Request request,HttpServletResponse response) throws IOException { if( !target.startsWith(path) ) @@ -30,10 +30,10 @@ return; response.setHeader("WWW-Authenticate","Basic realm=\""+path+"\""); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); - baseRequest.setHandled(true); + request.setHandled(true); } - private static String getPassword(HttpServletRequest request) { + private static String getPassword(Request request) { String auth = request.getHeader("Authorization"); if( auth==null ) return null;