abashev / vfs-s3

Amazon S3 driver for Apache commons-vfs (Virtual File System) project
Apache License 2.0
93 stars 50 forks source link

us-east-1 is hardcoded and no other region works #55

Closed boris-petrov closed 5 years ago

boris-petrov commented 5 years ago
Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-central-1' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed; Request ID: ...; S3 Extended Request ID: ...)

When I have s3://s3.eu-central-1.amazonaws.com/bucket-name as a URL. I believe the issue is here.

Also, is there any way to make vfs-s3 work with the original VFS code not your patched one? As we depend on their latest fixes...

abashev commented 5 years ago

We have a test for that https://github.com/abashev/vfs-s3/blob/branch-3.0.x/src/test/java/com/github/vfss3/S3FileNameParserTest.java#L22

But I'll check. Maybe do you have more information on how to reproduce it?

boris-petrov commented 5 years ago

Well, just create a bucket in a region other than us-east-1 and try connecting to it. It will blow up.

I changed the hardcoded string that I sent a link to to our region and it started working. You can blame the line to see which commit changed it.

boris-petrov commented 5 years ago

I think this is working with the latest commit so I'll leave you to close the issue when you please. Thanks for the support!