Skip to content

Commit 0ca177d

Browse files
committed
patch to remove Jetty-server inclusion in hadoop-auth.
Change-Id: I1d0e6dbe632cb8dafd2abb5c4a9e16fa8b487b72 (cherry picked from commit 7234b1d32fdcd093c77b8c8e0c99041b3d8d891a)
1 parent 3f2682b commit 0ca177d

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

hadoop-common-project/hadoop-auth/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@
193193
<artifactId>guava</artifactId>
194194
<scope>test</scope>
195195
</dependency>
196-
<dependency>
196+
<!--<dependency>
197197
<groupId>org.eclipse.jetty</groupId>
198198
<artifactId>jetty-server</artifactId>
199-
</dependency>
199+
</dependency>-->
200200
</dependencies>
201201

202202
<build>

hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/AuthenticationFilter.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.apache.hadoop.security.authentication.client.AuthenticationException;
2020
import org.apache.hadoop.security.authentication.client.KerberosAuthenticator;
2121
import org.apache.hadoop.security.authentication.util.*;
22-
import org.eclipse.jetty.server.Response;
2322
import org.slf4j.Logger;
2423
import org.slf4j.LoggerFactory;
2524

@@ -621,18 +620,18 @@ && getMaxInactiveInterval() > 0) {
621620
errCode = HttpServletResponse.SC_FORBIDDEN;
622621
}
623622
// After Jetty 9.4.21, sendError() no longer allows a custom message.
624-
// use setStatusWithReason() to set a custom message.
623+
// use setStatus() to set a custom message.
625624
String reason;
626625
if (authenticationEx == null) {
627626
reason = "Authentication required";
628627
} else {
629628
reason = authenticationEx.getMessage();
630629
}
631630

632-
if (httpResponse instanceof Response) {
631+
/*if (httpResponse instanceof Response) {
633632
((Response)httpResponse).setStatusWithReason(errCode, reason);
634-
}
635-
633+
}*/
634+
httpResponse.setStatus(errCode, reason);
636635
httpResponse.sendError(errCode, reason);
637636
}
638637
}

0 commit comments

Comments
 (0)