Skip to content

Document use of disableHostPrefixInjection for 2.18.x #3524

Description

@henricook

2.18.x introduced virtual bucket addressing as standard

i.e.
Before 2.18.x: I connected to bucket foo on mys3stub.mynetwork.local
But now: the SDK changes my configured hostname on the fly and tries to connect to foo.mys3stub.mynetwork.local.

I don't want to to have to setup DNS for every bucket name, I'd rather have the SDK connect the old way, without it modifying the hostname I configured. It's unclear how to achieve this.

I can't find any documentation on how to use disableHostPrefixInjection which I think from reading the code will stop this behaviour happening. Can it be documented? (and can anyone tell me the recommended way to use it?)

UPDATE: On further testing this doesn't seem to be the right option - any documentation you can provide on how to go back to having the bucket name in the path would be great

UPDATE 2: I've found something that works - is it right?

.forcePathStyle(true) - code example is Scala

  implicit val clientAsync: S3AsyncClient =
    S3AsyncClient
      .builder()
      .credentialsProvider(credentialsProvider)
      .region(region)
      .forcePathStyle(true)
      .endpointOverride(s3Uri)
      .build()

Links

NA (not sure where it's best to put it)

Metadata

Metadata

Assignees

Labels

documentationThis is a problem with documentation.p2This is a standard priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions