Skip to content

Cannot parse AWS S3 HTTP URLs without region #522

@kylebarron

Description

@kylebarron

Describe the bug

The AmazonS3Builder cannot parse this URL:

https://bucket.s3.amazonaws.com/path

It's preferred for URLs to include regions in the URL, like https://[bucket].s3.[region].amazonaws.com, but we should still allow the old-style URL.

To Reproduce

This test fails without any changes

        let mut builder = AmazonS3Builder::new();
        builder
            .parse_url("https://bucket.s3.amazonaws.com")
            .unwrap();
        assert_eq!(builder.bucket_name, Some("bucket".to_string()));
        assert!(builder.virtual_hosted_style_request.get().unwrap());

Expected behavior

Should parse URL

Additional context

ref developmentseed/obstore#589

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions