PradhanPrerak commented on code in PR #6550:
URL: https://github.com/apache/hadoop/pull/6550#discussion_r1644804835
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/AWSClientConfig.java:
##########
@@ -407,6 +413,48 @@ private static void initSigner(Configuration conf,
}
}
+ /**
+ *
+ * @param conf hadoop configuration
+ * @param clientConfig client configuration to update
+ * @param awsServiceIdentifier service name
+ */
+ private static void initRequestHeaders(Configuration conf,
+ ClientOverrideConfiguration.Builder clientConfig, String
awsServiceIdentifier) {
+ String configKey = null;
+ switch (awsServiceIdentifier) {
+ case AWS_SERVICE_IDENTIFIER_S3:
+ configKey = CUSTOM_HEADERS_S3;
+ break;
+ case AWS_SERVICE_IDENTIFIER_STS:
+ configKey = CUSTOM_HEADERS_STS;
+ break;
+ default:
+ // Nothing to do. The original signer override is already setup
+ }
+ if (configKey != null) {
+ String[] customHeaders = conf.getTrimmedStrings(configKey);
+ if (customHeaders == null || customHeaders.length == 0) {
+ LOG.debug("No custom headers specified");
+ return;
+ }
+
+ for (String customHeader : customHeaders) {
Review Comment:
Thank you, I have revised the PR based on the feedback.
>How do the s3 and STS stores react to unknown headers? What do they support
today? I'm curious
They ignore unknown headers. there are multiple use cases as mentioned
[here](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html).
One of the common use case I could think of is `Content-Type`, which is
required for s3 write requests with body having html or something.
--
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]