Skip to content

Commit

Permalink
feat: allow manipulation on presigned urls (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop authored Mar 17, 2023
1 parent 771dca1 commit b1ce470
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion controller/get_file_with_presigned_url.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,18 @@ func (ctrl *Controller) getFileWithPresignedURLParse(ctx *gin.Context) (GetFileW
return GetFileWithPresignedURLRequest{}, apiErr //nolint: exhaustruct
}

signature := make(url.Values, len(ctx.Request.URL.Query()))
for k, v := range ctx.Request.URL.Query() {
switch k {
case "w", "h", "q", "b":
default:
signature[k] = v
}
}

return GetFileWithPresignedURLRequest{
fileID: ctx.Param("id"),
signature: ctx.Request.URL.RawQuery,
signature: signature.Encode(),
headers: headers,
Expires: expires,
}, nil
Expand Down

0 comments on commit b1ce470

Please sign in to comment.