Skip to content

Commit 9dcfc37

Browse files
committed
fix signature verification of camelCased subresource URIs
1 parent 906b318 commit 9dcfc37

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: lib/middleware/authentication.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ module.exports = () =>
5555
return next();
5656
}
5757

58-
const query = mapKeys(ctx.query, (value, key) => key.toLowerCase());
5958
const amzQueryHeaders = pickBy(
60-
query,
59+
mapKeys(ctx.query, (value, key) => key.toLowerCase()),
6160
(value, key) =>
6261
key.startsWith('x-amz-') &&
6362
// x-amz-website-redirect-location isn't a canonical header
@@ -108,7 +107,7 @@ module.exports = () =>
108107
.map(encodeURIComponentRFC3986)
109108
.join('/');
110109

111-
const canonicalizedQueryString = Object.entries(query)
110+
const canonicalizedQueryString = Object.entries(ctx.query)
112111
.filter(
113112
([param]) =>
114113
SUBRESOURCES[param] ||

0 commit comments

Comments
 (0)