Skip to content

Commit

Permalink
fix: Correctly canonicalize query param spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel-rowe committed Feb 15, 2023
1 parent 5726481 commit 99cd43d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export class AWSSignerV4 implements Signer {
const urlObj = new URL(request.url);
const { host, pathname, searchParams } = urlObj;
searchParams.sort();
const canonicalQuerystring = searchParams.toString();
// per https://docs.aws.amazon.com/general/latest/gr/create-signed-request.html#create-canonical-request
const canonicalQuerystring = searchParams.toString().replaceAll("+", "%20");

const headers = new Headers(request.headers);

Expand Down

0 comments on commit 99cd43d

Please sign in to comment.