Nodejs-storage: MalformedSecurityHeader error in url returned by getSignedUrl

Created on 10 May 2019  路  4Comments  路  Source: googleapis/nodejs-storage

Hi, i have a problem with getting signed url from my bucket in firebase storage.

      .file(filename)
      .getSignedUrl({
        action: 'read',
        expires,
        contentType: 'image/*'
      })
      .then(urls => {
        console.log(urls[0])
        return urls[0]
      })

If i opened url in browser i get error like:

<Error>
<Code>MalformedSecurityHeader</Code>
<Message>Your request has a malformed header.</Message>
<ParameterName>signature</ParameterName>
<Details>Signature was not base64 encoded</Details>
</Error>

If i replace storage.googleapis.com with storage.cloud.google.com i get 403 Forbidden error.

Can someone help me to solve this problem ?


lib version: "firebase-admin": "7.3.0"
storage lib version in firebase-admin: "@google-cloud/storage": "^2.3.0"

storage

Most helpful comment

SOLVED: Visual studio code automatically decode urls and change %2 to / if you use cmd+click to open urls.

All 4 comments

SOLVED: Visual studio code automatically decode urls and change %2 to / if you use cmd+click to open urls.

You saved my day man @hstemplewski , thanks a lot

Thank you!

Thanks a lot @hstemplewski

Was this page helpful?
0 / 5 - 0 ratings