Comparing version 0.0.6 to 1.0.0
22
index.js
@@ -9,2 +9,19 @@ var sha256 = require('crypto-js/sha256'); | ||
function encodeRfc3986(urlEncodedString) { | ||
return urlEncodedString.replace(/[!'()*]/g, function(c) { | ||
return '%' + c.charCodeAt(0).toString(16).toUpperCase() | ||
}) | ||
} | ||
function encodeRfc3986Full(str) { | ||
return encodeRfc3986(encodeURIComponent(str)) | ||
} | ||
function encodePath(path) { | ||
path = decodeURIComponent(path.replace(/\+/g, ' ')); | ||
path = encodeRfc3986Full(path); | ||
path = path.replace(/%2F/g, '/') | ||
return path; | ||
} | ||
function getSignatureKey(key, dateStamp, regionName, serviceName) { | ||
@@ -28,5 +45,6 @@ var keyDate = hmacSha256(dateStamp, "AWS4" + key); | ||
const endpoint = `https://${host}${path}`; | ||
const encodedPath = encodePath(path); | ||
const endpoint = `https://${host}${encodedPath}`; | ||
const canonicalUri = path; | ||
const canonicalUri = encodedPath; | ||
const canonicalQuerystring = ''; | ||
@@ -33,0 +51,0 @@ const payloadHash = sha256(body).toString(); |
{ | ||
"name": "amazon-s3", | ||
"version": "0.0.6", | ||
"version": "1.0.0", | ||
"description": "Read and write to AWS S3 using fetch()", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6526
85
1