Pankaj260100 commented on code in PR #15753:
URL: https://github.com/apache/druid/pull/15753#discussion_r1466037066
##########
extensions-core/druid-pac4j/src/main/java/org/apache/druid/security/pac4j/Pac4jFilter.java:
##########
@@ -48,7 +52,29 @@ public class Pac4jFilter implements Filter
{
private static final Logger LOGGER = new Logger(Pac4jFilter.class);
- private static final HttpActionAdapter<String, JEEContext>
NOOP_HTTP_ACTION_ADAPTER = (HttpAction code, JEEContext ctx) -> null;
+ private static final HttpActionAdapter<String, JEEContext>
HTTP_ACTION_ADAPTER = (HttpAction action, JEEContext context) -> {
+ if (action instanceof RedirectionAction) {
+ int code = action.getCode();
+ HttpServletResponse response = context.getNativeResponse();
+ response.setStatus(code);
+ if (action instanceof WithLocationAction) {
+ WithLocationAction withLocationAction = (WithLocationAction) action;
+ context.setResponseHeader("Location",
withLocationAction.getLocation());
+ } else if (action instanceof WithContentAction) {
+ WithContentAction withContentAction = (WithContentAction) action;
+ String content = withContentAction.getContent();
+ if (content != null) {
+ try {
+ response.getWriter().write(content);
+ }
+ catch (IOException var8) {
Review Comment:
yeah, I copied it from the JEEHttpActionAdapter. I have updated it to use
JEEHttpActionAdapter instead of creating a new one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]