Describe the bug
I want to use S3 V2 SDK to visit aliyun oss. The aliyun oss only supports virtual hosted.
But if I override the endpoint with "http://oss-cn-beijing.aliyuncs.com", the S3Client always chooses path style.
Expected Behavior
S3Client chooses virtual hosted style to request server.
Current Behavior
S3Client use path style.
Steps to Reproduce
S3Client client = S3Client.builder().endpointOverride(new URI("http://oss-cn-beijing.aliyuncs.com")).build();
client.putObject(); // the client will choose path style instead of virtual-hosted style.
Possible Solution

It will choose virtual-hosted style only the host startswith "s3"
Context
I can't use aws sdk to visit aliyun service.
Your Environment
- AWS Java SDK version used: 2.15.67
- JDK version used: 11 Coretto
- Operating System and version: macOS Big Sur.
Describe the bug
I want to use S3 V2 SDK to visit aliyun oss. The aliyun oss only supports virtual hosted.
But if I override the endpoint with "http://oss-cn-beijing.aliyuncs.com", the S3Client always chooses path style.
Expected Behavior
S3Client chooses virtual hosted style to request server.
Current Behavior
S3Client use path style.
Steps to Reproduce
Possible Solution
It will choose virtual-hosted style only the host startswith "s3"
Context
I can't use aws sdk to visit aliyun service.
Your Environment