Skip to content

[aws_s3] Path to Virtual Hosted-Style workaround with middleware #631

Discussion options

You must be logged in to vote

Customizing the middleware on the underlying Smithy client replaces the entire middleware stack, so the built-in credential and endpoint middlewares (among others) from the SDK won't be in the chain unless they're also added during client creation.

Fortunately, there's a better way to customize requests now that doesn't require touching middleware. For example:

let response = client.head_bucket()
    .bucket("example")
    .customize()
    .await?
    .mutate_request(|mut req| {
        // change the URI on `req` here
    })
    .send()
    .await?;

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@josephalfredo-okta
Comment options

@jdisanti
Comment options

@zhangkaizhao
Comment options

Answer selected by josephalfredo-okta
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants