HADOOP-17621. hadoop-auth to remove jetty-server dependency. (#2865)
Reviewed-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
parent
f608cda729
commit
dac60b8282
@ -193,10 +193,6 @@
|
||||
<artifactId>guava</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -19,7 +19,6 @@
|
||||
import org.apache.hadoop.security.authentication.client.AuthenticationException;
|
||||
import org.apache.hadoop.security.authentication.client.KerberosAuthenticator;
|
||||
import org.apache.hadoop.security.authentication.util.*;
|
||||
import org.eclipse.jetty.server.Response;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -621,7 +620,7 @@ && getMaxInactiveInterval() > 0) {
|
||||
errCode = HttpServletResponse.SC_FORBIDDEN;
|
||||
}
|
||||
// After Jetty 9.4.21, sendError() no longer allows a custom message.
|
||||
// use setStatusWithReason() to set a custom message.
|
||||
// use setStatus() to set a custom message.
|
||||
String reason;
|
||||
if (authenticationEx == null) {
|
||||
reason = "Authentication required";
|
||||
@ -629,10 +628,7 @@ && getMaxInactiveInterval() > 0) {
|
||||
reason = authenticationEx.getMessage();
|
||||
}
|
||||
|
||||
if (httpResponse instanceof Response) {
|
||||
((Response)httpResponse).setStatusWithReason(errCode, reason);
|
||||
}
|
||||
|
||||
httpResponse.setStatus(errCode, reason);
|
||||
httpResponse.sendError(errCode, reason);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user