You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by we...@apache.org on 2021/04/07 05:45:57 UTC
[hadoop] branch branch-3.3 updated: HADOOP-17621. hadoop-auth to
remove jetty-server dependency. (#2865)
This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.3 by this push:
new 1110b03 HADOOP-17621. hadoop-auth to remove jetty-server dependency. (#2865)
1110b03 is described below
commit 1110b03752b45bc4695baaa6d9655e18de67303a
Author: Wei-Chiu Chuang <we...@apache.org>
AuthorDate: Tue Apr 6 21:55:01 2021 -0700
HADOOP-17621. hadoop-auth to remove jetty-server dependency. (#2865)
Reviewed-by: Akira Ajisaka <aa...@apache.org>
(cherry picked from commit dac60b8282013d7776667415a429e7ca35efba66)
---
hadoop-common-project/hadoop-auth/pom.xml | 6 +-----
.../security/authentication/server/AuthenticationFilter.java | 8 ++------
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/hadoop-common-project/hadoop-auth/pom.xml b/hadoop-common-project/hadoop-auth/pom.xml
index e1309ca..057c47f 100644
--- a/hadoop-common-project/hadoop-auth/pom.xml
+++ b/hadoop-common-project/hadoop-auth/pom.xml
@@ -193,11 +193,7 @@
<artifactId>guava</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- </dependency>
- </dependencies>
+ </dependencies>
<build>
<plugins>
diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/AuthenticationFilter.java b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/AuthenticationFilter.java
index 9f40c42..b339a5d 100644
--- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/AuthenticationFilter.java
+++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/AuthenticationFilter.java
@@ -19,7 +19,6 @@ import org.apache.hadoop.security.authentication.client.AuthenticatedURL;
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 @@ public class AuthenticationFilter implements Filter {
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 @@ public class AuthenticationFilter implements Filter {
reason = authenticationEx.getMessage();
}
- if (httpResponse instanceof Response) {
- ((Response)httpResponse).setStatusWithReason(errCode, reason);
- }
-
+ httpResponse.setStatus(errCode, reason);
httpResponse.sendError(errCode, reason);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org