fcaylus commented on a change in pull request #14345:
URL: https://github.com/apache/beam/pull/14345#discussion_r606699782



##########
File path: 
sdks/java/io/elasticsearch/src/main/java/org/apache/beam/sdk/io/elasticsearch/ElasticsearchIO.java
##########
@@ -424,6 +460,14 @@ RestClient createClient() throws IOException {
             httpAsyncClientBuilder ->
                 
httpAsyncClientBuilder.setDefaultCredentialsProvider(credentialsProvider));
       }
+      if (getApiKey() != null) {
+        restClientBuilder.setDefaultHeaders(
+            new Header[] {new BasicHeader("Authorization", "ApiKey " + 
getApiKey())});

Review comment:
       After some research, there is no way in the Elasticsearch SDK to 
retrieve the headers of a request (or the default headers of the `RestClient`). 
I don't think there is an "easy way" to test it.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to