You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When bucket is created with custom region, if the endpoint contains standard port like 80. The returned presigned urls are wrong due to not having port in the URL. In other words, S3 server says invalid signature due to host mismatch.
To Reproduce
`
let region = Region::Custom {
region: "eu-central-1",
endpoint: "http://minio:80",
}
let credentials = Credentials::new(
Some(&conf.access_key),
Some(&conf.secret_access_key.value()),
None,
None,
None,
).unwrap();
let bucket = Bucket::new(&conf.bucket_name, region, credentials)
.unwrap()
.with_path_style();
let url = bucket
.presign_get(id, self.pre_signed_url_expiration, None)
.await();`
This returns something like below, note that it should be "minio:80" in the url:
Expected behavior
A clear and concise description of what you expected to happen.
When we manually add :80 to the url, everything works fine. So, presigned url should be returned with port.
It should return the url with port for signature verification. It works fine for hosts with non-standard ports. For instance, if you use "http://minio:9000", url will be as below which is correct:
Describe the bug
When bucket is created with custom region, if the
endpoint
contains standard port like 80. The returned presigned urls are wrong due to not having port in the URL. In other words, S3 server says invalid signature due to host mismatch.To Reproduce
`
let region = Region::Custom {
region: "eu-central-1",
endpoint: "http://minio:80",
}
let credentials = Credentials::new(
Some(&conf.access_key),
Some(&conf.secret_access_key.value()),
None,
None,
None,
).unwrap();
let bucket = Bucket::new(&conf.bucket_name, region, credentials)
.unwrap()
.with_path_style();
let url = bucket
.presign_get(id, self.pre_signed_url_expiration, None)
.await();`
This returns something like below, note that it should be "minio:80" in the url:
Expected behavior
A clear and concise description of what you expected to happen.
When we manually add
:80
to the url, everything works fine. So, presigned url should be returned with port.It should return the url with port for signature verification. It works fine for hosts with non-standard ports. For instance, if you use "http://minio:9000", url will be as below which is correct:
Environment
1.83
0.35.1
Additional context
This is happening due to internal use of
Url::parse
, then string formatting while returning the presigned url to the user.The text was updated successfully, but these errors were encountered: