tustvold commented on code in PR #5652:
URL: https://github.com/apache/arrow-rs/pull/5652#discussion_r1567376458


##########
object_store/src/aws/client.rs:
##########
@@ -335,81 +396,19 @@ impl S3Client {
         Ok(Self { config, client })
     }
 
-    /// Make an S3 PUT request 
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html>
-    ///
-    /// Returns the ETag
-    pub fn put_request<'a>(
-        &'a self,
-        path: &'a Path,
-        payload: PutPayload,
-        attributes: Attributes,
-        with_encryption_headers: bool,
-    ) -> Request<'a> {
+    pub fn request<'a>(&'a self, method: Method, path: &'a Path) -> 
Request<'a> {
         let url = self.config.path_url(path);
-        let mut builder = self.client.request(Method::PUT, url);
-        if with_encryption_headers {
-            builder = 
builder.headers(self.config.encryption_headers.clone().into());
-        }
-
-        let mut sha256 = Context::new(&digest::SHA256);
-        payload.iter().for_each(|x| sha256.update(x));
-        let payload_sha256 = sha256.finish();
-
-        if let Some(Checksum::SHA256) = self.config.checksum {
-            builder = builder.header(
-                "x-amz-checksum-sha256",
-                BASE64_STANDARD.encode(payload_sha256),
-            )
-        }
-
-        let mut has_content_type = false;
-        for (k, v) in &attributes {
-            builder = match k {
-                Attribute::CacheControl => builder.header(CACHE_CONTROL, 
v.as_ref()),
-                Attribute::ContentType => {
-                    has_content_type = true;
-                    builder.header(CONTENT_TYPE, v.as_ref())
-                }
-            };
-        }
-
-        if !has_content_type {
-            if let Some(value) = 
self.config.client_options.get_content_type(path) {
-                builder = builder.header(CONTENT_TYPE, value);
-            }
-        }

Review Comment:
   Previously we were specifying these for put_part uploads which is 
technically not correct (although appears to be harmless)



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

Reply via email to