Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s3 config with use_accelerate_endpoint and generate_presigned_post does not work #978

Closed
jnoring opened this issue Jul 11, 2016 · 4 comments
Labels
bug This issue is a confirmed bug.

Comments

@jnoring
Copy link

jnoring commented Jul 11, 2016

This code:

    s3 = boto3.client('s3', config=Config(s3={'use_accelerate_endpoint': True}))
    s3.generate_presigned_post(
        Bucket = 'some bucket,
        Key = 'some key'
    )

...will not result in an accelerated URL being generated for a presigned post operation. The bug is in this code, in client.py:

        # Enable accelerate if the configuration is set to to true or the
        # endpoint being used matches one of the Accelerate endpoints.
        if s3_accelerate or S3_ACCELERATE_ENDPOINT in self._endpoint.host:
            # Amazon S3 accelerate is being used then always use the virtual
            # style of addressing because it is required.
            self._force_virtual_style_s3_addressing()
            # Also make sure that the hostname gets switched to
            # s3-accelerate.amazonaws.com
            self.meta.events.register_first(
                'request-created.s3', switch_host_s3_accelerate)

...request-created.s3 is never called for a presigned post because no request to s3 is made, and thus switch_host_s3_accelerate is not called.

@kyleknap
Copy link
Contributor

I can confirm. That looks to be the issue as well.

@kyleknap kyleknap added the bug This issue is a confirmed bug. label Jul 12, 2016
@kevinbui001
Copy link

Has this been fixed?

@johnd08
Copy link

johnd08 commented Apr 25, 2017

Issue is still there in version 1.4.4 - are there any plans to fix this?

@joshma
Copy link

joshma commented Nov 21, 2017

It's been 16 months, has anyone found a fix or workaround? Looks like url.replace(S3_HOST, 's3-accelerate') works, but that's pretty hacky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

5 participants