mag1cfrog commented on code in PR #872:
URL: 
https://github.com/apache/arrow-rs-object-store/pull/872#discussion_r4352111368


##########
src/parse.rs:
##########
@@ -122,7 +122,8 @@ impl ObjectStoreScheme {
                 {
                     (Self::MicrosoftAzure, strip_bucket().unwrap_or_default())
                 } else if host.ends_with("amazonaws.com") {
-                    match host.starts_with("s3") {
+                    // Virtual-hosted URLs have a bucket name before the S3 
service label.
+                    match host.starts_with("s3") && !host.contains(".s3") {

Review Comment:
   Thanks for reviewing!
   One concern is legacy path-style URLs, for example:
   https://s3-us-west-2.amazonaws.com/usgs-lidar-public/IA_FullState/ept.json
   With host.starts_with("s3."), this would return 
usgs-lidar-public/IA_FullState/ept.json instead of IA_FullState/ept.json. The 
current change preserves the existing behavior for this case.
   I also noticed that AmazonS3Builder already rejects this format. Since 
ObjectStoreScheme::parse can be used independently, should we preserve its 
existing handling of legacy URLs here?
   Happy to adopt your suggestion if that compatibility is out of scope, or add 
a regression test if we want to retain it.



-- 
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]

Reply via email to