Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
package org.opensearch.security.support;

import java.io.Serializable;
import java.util.Map;

import com.google.common.base.Strings;

Expand Down Expand Up @@ -56,15 +55,8 @@ public static String getSafeFromHeader(final ThreadContext context, final String
return null;
}

String headerValue = null;

Map<String, String> headers = context.getHeaders();
if (!headers.containsKey(headerName) || (headerValue = headers.get(headerName)) == null) {
return null;
}

if (isInterClusterRequest(context) || isTrustedClusterRequest(context) || isDirectRequest(context)) {
return headerValue;
return context.getHeader(headerName);
}

return null;
Expand Down