Open keithsharp opened 1 year ago
@keithsharp Thanks for reporting this.
@jmklix This looks like a documentation issue for S3. Have other SDKs received reports of this?
Looking at the relevant deserialization code, we're not doing anything to format the location
:
pub(crate) fn deser_header_create_bucket_create_bucket_output_location(
header_map: &http::HeaderMap,
) -> std::result::Result<
std::option::Option<std::string::String>,
aws_smithy_http::header::ParseError,
> {
let headers = header_map.get_all("Location").iter();
aws_smithy_http::header::one_or_none(headers)
}
To add, this behavior is reproducible when a bucket configuration is specified. In other words, if we comment out the following line
let resp = client.create_bucket()
.bucket("my-test-bucket")
// .create_bucket_configuration(cfg)
.send()
.await?;
then resp.location().unwrap()
returns /my-test-bucket
.
Specifying a bucket configuration adds the following to the request body
<CreateBucketConfiguration xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><LocationConstraint>eu-west-1</LocationConstraint></CreateBucketConfiguration>
and changes S3's behavior of returning the bucket location: http://my-test-bucket.s3.amazonaws.com/
.
Describe the issue
The documentation states
location()
returns: "A forward slash followed by the name of the bucket.". This should be updated to match the current behavior when creating an S3 bucket:The output is:
Links
https://docs.rs/aws-sdk-s3/latest/aws_sdk_s3/output/struct.CreateBucketOutput.html#method.location