@aws-sdk/signature-v4
Advanced tools
Comparing version 3.53.0 to 3.54.0
@@ -127,4 +127,18 @@ "use strict"; | ||
if (this.uriEscapePath) { | ||
const doubleEncoded = encodeURIComponent(path.replace(/^\//, "")); | ||
return `/${doubleEncoded.replace(/%2F/g, "/")}`; | ||
const normalizedPathSegments = []; | ||
for (const pathSegment of path.split("/")) { | ||
if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0) | ||
continue; | ||
if (pathSegment === ".") | ||
continue; | ||
if (pathSegment === "..") { | ||
normalizedPathSegments.pop(); | ||
} | ||
else { | ||
normalizedPathSegments.push(pathSegment); | ||
} | ||
} | ||
const normalizedPath = `${(path === null || path === void 0 ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path === null || path === void 0 ? void 0 : path.endsWith("/")) ? "/" : ""}`; | ||
const doubleEncoded = encodeURIComponent(normalizedPath); | ||
return doubleEncoded.replace(/%2F/g, "/"); | ||
} | ||
@@ -131,0 +145,0 @@ return path; |
@@ -1,2 +0,2 @@ | ||
import { __awaiter, __generator } from "tslib"; | ||
import { __awaiter, __generator, __values } from "tslib"; | ||
import { toHex } from "@aws-sdk/util-hex-encoding"; | ||
@@ -229,6 +229,31 @@ import { ALGORITHM_IDENTIFIER, ALGORITHM_QUERY_PARAM, AMZ_DATE_HEADER, AMZ_DATE_QUERY_PARAM, AUTH_HEADER, CREDENTIAL_QUERY_PARAM, EVENT_ALGORITHM_IDENTIFIER, EXPIRES_QUERY_PARAM, MAX_PRESIGNED_TTL, SHA256_HEADER, SIGNATURE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, TOKEN_HEADER, TOKEN_QUERY_PARAM, } from "./constants"; | ||
SignatureV4.prototype.getCanonicalPath = function (_a) { | ||
var e_1, _b; | ||
var path = _a.path; | ||
if (this.uriEscapePath) { | ||
var doubleEncoded = encodeURIComponent(path.replace(/^\//, "")); | ||
return "/" + doubleEncoded.replace(/%2F/g, "/"); | ||
var normalizedPathSegments = []; | ||
try { | ||
for (var _c = __values(path.split("/")), _d = _c.next(); !_d.done; _d = _c.next()) { | ||
var pathSegment = _d.value; | ||
if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0) | ||
continue; | ||
if (pathSegment === ".") | ||
continue; | ||
if (pathSegment === "..") { | ||
normalizedPathSegments.pop(); | ||
} | ||
else { | ||
normalizedPathSegments.push(pathSegment); | ||
} | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_d && !_d.done && (_b = _c.return)) _b.call(_c); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
var normalizedPath = "" + ((path === null || path === void 0 ? void 0 : path.startsWith("/")) ? "/" : "") + normalizedPathSegments.join("/") + (normalizedPathSegments.length > 0 && (path === null || path === void 0 ? void 0 : path.endsWith("/")) ? "/" : ""); | ||
var doubleEncoded = encodeURIComponent(normalizedPath); | ||
return doubleEncoded.replace(/%2F/g, "/"); | ||
} | ||
@@ -235,0 +260,0 @@ return path; |
{ | ||
"name": "@aws-sdk/signature-v4", | ||
"version": "3.53.0", | ||
"version": "3.54.0", | ||
"description": "A standalone implementation of the AWS Signature V4 request signing algorithm", | ||
@@ -24,3 +24,3 @@ "main": "./dist-cjs/index.js", | ||
"@aws-sdk/is-array-buffer": "3.52.0", | ||
"@aws-sdk/types": "3.53.0", | ||
"@aws-sdk/types": "3.54.0", | ||
"@aws-sdk/util-hex-encoding": "3.52.0", | ||
@@ -32,3 +32,3 @@ "@aws-sdk/util-uri-escape": "3.52.0", | ||
"@aws-crypto/sha256-js": "2.0.0", | ||
"@aws-sdk/protocol-http": "3.53.0", | ||
"@aws-sdk/protocol-http": "3.54.0", | ||
"@aws-sdk/util-buffer-from": "3.52.0", | ||
@@ -35,0 +35,0 @@ "@tsconfig/recommended": "1.0.1", |
Sorry, the diff of this file is too big to display
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
191816
2290
+ Added@aws-sdk/types@3.54.0(transitive)
- Removed@aws-sdk/types@3.53.0(transitive)
Updated@aws-sdk/types@3.54.0