Skip to content

Commit

Permalink
Merge branch 'improve-compressed-handling' of https://github.com/cwpe…
Browse files Browse the repository at this point in the history
…rks/security into improve-compressed-handling
  • Loading branch information
cwperks committed Oct 5, 2023
2 parents 4d487fa + 34d33ca commit a9bf8b9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import org.opensearch.security.support.ConfigConstants;
import org.opensearch.security.support.HTTPHelper;
import org.opensearch.security.user.User;
import org.opensearch.tasks.Task;
import org.opensearch.threadpool.ThreadPool;

import static com.amazon.dlic.auth.http.saml.HTTPSamlAuthenticator.API_AUTHTOKEN_SUFFIX;
Expand Down Expand Up @@ -149,7 +150,13 @@ public RestHandler wrap(RestHandler original, AdminDNs adminDNs) {
}

if (storedContext != null) {
// TODO find a more generic way of restoring headers added in the RestController
// Relates to TaskTests.testXOpaqueIdHeader
// https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/rest/RestController.java#L360-L378
String xOpaqueId = threadContext.getHeader(Task.X_OPAQUE_ID);
storedContext.restore();
threadContext.putHeader(Task.X_OPAQUE_ID, xOpaqueId);

}
}

Expand Down

0 comments on commit a9bf8b9

Please sign in to comment.