S3Utilities.parseUri() doesn't work with localhost-based URIs (specifically, LocalStack) #4996
Labels
closing-soon
This issue will close in 4 days unless further comments are made.
feature-request
A feature should be added or improved.
Describe the bug
The
parseUri()
helper method in S3Utilities throws an Exception when the given URI does not contain the string "s3", which means it can not be used when testing with LocalStack.Expected Behavior
I would expect
parseUri
to return a correctly parsedS3Uri
with the provided information.Current Behavior
parseURI
throws an exception.Reproduction Steps
Possible Solution
Alter the regex to no longer require the string "s3" to be part of the URI being parsed. This would take a little bit of rework because the location of that substring in the hostname is used to determine if the URI is using path-based vs virtualhost-based routing.
Additional Information/Context
The original discussion around including the
parseUri
method in the first place offers some insight into why this might have been intended behavior, or at the very least why this issue would have been ignored.#272 (comment)
However, simply including the string "s3" in the hostname doesn't actually enforce that the URL is owned by Amazon's S3 service.
AWS Java SDK version used
2.20.112
JDK version used
openjdk 11.0.15 2022-04-19 LTS
Operating System and version
OSX 14.3.1
The text was updated successfully, but these errors were encountered: