a10y opened a new issue, #779:
URL: https://github.com/apache/arrow-rs-object-store/issues/779
**Describe the bug**
S3 supports both standard endpoints, e.g. `s3.REGION.amazonaws.com`, as well
as a dual-stack endpoint variant, which allows clients to resolve either
IPv4/v6, e.g. `s3.dualstack.REGION.amazonaws.com`
**To Reproduce**
The following unit test using the `DefaultObjectStoreRegistry` fails to
properly resolve a store for a dualstack endpoint:
```
#[test]
fn test_resolve_s3_dualstack_endpoint() {
let registry = DefaultObjectStoreRegistry::new();
let url = Url::parse(
"https://s3.dualstack.us-east-1.amazonaws.com/static.customizedgirl.com/images/design/3747d20127af39238a380d4fface92b1_1639568_0_bigger.jpg",
)
.unwrap();
let (_store, path) = registry
.resolve(&url)
.expect("registry should resolve S3 dual-stack endpoints");
// The bucket (`static.customizedgirl.com`) is the first path
segment and
// should be stripped, leaving the object key as the trailing path.
assert_eq!(
path.as_ref(),
"images/design/3747d20127af39238a380d4fface92b1_1639568_0_bigger.jpg"
);
}
```
**Expected behavior**
The registry should return an `AmazonS3` store with the dualstack endpoint
configured and the `us-east-1` region set.
**Additional context**
I noticed this while trying to write some code that downloads data from the
[PIXMO dataset](https://huggingface.co/datasets/allenai/pixmo-cap) on
HuggingFace, which is a collection of image URLs and descriptions.
The repro above uses the URL which failed for me.
--
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]