-
Notifications
You must be signed in to change notification settings - Fork 158
Description
When calling ExAws.S3.list_multi_part_uploads on an oracle s3 bucket, the api returns a ListBucketResult and the parser explodes -- however AWS works as expected.
Taking a look at what gets called under the hood we see a GET request to
https://<id>.compat.objectstorage.<region>.oraclecloud.com/<bucket_name>/?uploads=1
where <id>.compat.objectstorage.<region>.oraclecloud.com is the url oracle gives you.
Maybe oracle doesn't implement this correctly, but when we use boto / s3 api command line tool it makes a GET request to
https://<id>.compat.objectstorage.<region>.oraclecloud.com/<bucket_name>?uploads
And this correctly returns a ListMultipartUploadsResult.
So If I crudely patch ExAws.S3 to make a call to that url in ExAws.Operation.S3
url =
operation
|> add_resource_to_params()
|> ExAws.Request.Url.build(config)
url = if String.contains?(url , "?uploads=1") do
# replace
String.replace(url, "?uploads=1", "?uploads")
else
url
end
The whole thing works as expected, and we get a ListMultipartUploadsResult which parses fine.
AWS s3 supports ?uploads=1 and ?uploads.
Seems like the extra =1 shouldn't be added for a start, the s3 api doesn't expect a param like that
https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html