http-message-signatures
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -65,3 +65,5 @@ "use strict"; | ||
const { pathname } = typeof context.url === 'string' ? new URL(context.url) : context.url; | ||
return [decodeURI(pathname)]; | ||
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures#section-2.2.6 | ||
// empty path means use `/` | ||
return [pathname || '/']; | ||
} | ||
@@ -75,3 +77,3 @@ case '@query': { | ||
// absent query params means use `?` | ||
return [decodeURI(search) || '?']; | ||
return [search || '?']; | ||
} | ||
@@ -86,7 +88,7 @@ case '@query-param': { | ||
} | ||
const name = params.get('name').toString(); | ||
const name = decodeURIComponent(params.get('name').toString()); | ||
if (!searchParams.has(name)) { | ||
throw new Error(`Expected query parameter "${name}" not found`); | ||
} | ||
return searchParams.getAll(name); | ||
return searchParams.getAll(name).map((value) => encodeURIComponent(value)); | ||
} | ||
@@ -93,0 +95,0 @@ case '@status': { |
{ | ||
"name": "http-message-signatures", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "HTTP message signature implementation", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
113085
1360