Skip to content

Commit

Permalink
fix: decode URI before signing the url
Browse files Browse the repository at this point in the history
  • Loading branch information
inian committed Mar 17, 2021
1 parent a70be97 commit f93f316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/object/getSignedURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default async function routes(fastify: FastifyInstance) {

console.log(`going to sign ${request.url}`)
const urlParts = request.url.split('/')
const urlToSign = urlParts.splice(3).join('/')
const urlToSign = decodeURI(urlParts.splice(3).join('/'))
const token = await signJWT({ url: urlToSign }, expiresIn)

// @todo parse the url properly
Expand Down

0 comments on commit f93f316

Please # to comment.