-
Notifications
You must be signed in to change notification settings - Fork 9
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
MalformedSecurityHeader #7
Comments
Hi @danieldocki What did you pass to the generate() funciton, a |
defmodule App.Storage do
@bucket "my-bucket"
def url(%{key: key, checksum: checkum, content_type: content_type}) do
GcsSignedUrl.generate(
client(),
@bucket,
key,
verb: "GET",
md5_digest: checkum,
content_type: content_type,
expires: GcsSignedUrl.hours_after(3)
)
end
defp client do
"./config/gcs.json"
|> Path.expand()
|> File.read!()
|> Poison.decode!()
|> GcsSignedUrl.Client.load()
end
end |
Version 0.4.0 of gcs_signed_url? |
Yes! |
Strange! I just ran the exact same code as you, the resulting URL works. What elixir / erlang versions are you on? But then again the error says the signature was not base64 encoded and I don't see this being changed between versions. Is it possible the URL gets changed after generating? escaped, some chars missing? |
This is one of the generated URL's
|
So I'm using CURL to make a request to the URL you generated. Obviously I don't know the correct values for the two headers content-md5 and content-type. But here's what I get:
Response:
This is what I would expect with wrong headers... |
Thanks, I will search the error. But the gcs.json is correct because I using it in a rails app and is working. Thank's for your time |
Yeah no, the URL you get seems correct. Try my CURL command and replace the content-md5 and content-type headers with the correct ones to check. |
I'm gonna close this if there are no further questions. |
It seems that GCP requires percent encoding for characters such as `+` and `/`, or otherwise the request will fail with a complaint that the Signature was not base64 encoded. Related issue: alexandrubagu#7
I got this error, V2 API
The text was updated successfully, but these errors were encountered: