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

SignatureDoesNotMatch when supplying content_type #8

Open
Brianvdb opened this issue Sep 14, 2018 · 1 comment
Open

SignatureDoesNotMatch when supplying content_type #8

Brianvdb opened this issue Sep 14, 2018 · 1 comment

Comments

@Brianvdb
Copy link

Brianvdb commented Sep 14, 2018

json
|> GcsSigner.Client.from_keyfile
|> GcsSigner.sign_url(object.bucket, object.name, expires: 7826133600, content_type: "image/*")

This generates an URL as expected. But when navigating to it I receive the following error:

<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>
The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.
</Message>
<StringToSign>
.... etc....
</StringToSign>
</Error>

When i remove the content_type opt it works as expected. What is going wrong?

@premist
Copy link
Member

premist commented Oct 13, 2018

@Brianvdb Hello there, thanks for your issue and sorry I couldn't reply sooner.

Currently I'm not actively working on Elixir-based projects, so it may be later that I will be able to allocate some time and investigate this.

I wonder if "image/*" is the culprit — so far I only used the exact match on Content-Type header like image/jpg so don't have an experience with working on Content-Type specification with wildcard.

Have you tried using exact Content-Type and experienced similar issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants