@mcma/client
Advanced tools
Comparing version 0.13.23 to 0.13.24
@@ -97,13 +97,28 @@ "use strict"; | ||
} | ||
if (this.authenticator) { | ||
await this.authenticator.sign(config); | ||
} | ||
// add tracker header, if a tracker is present | ||
if (config.tracker) { | ||
if (!config.headers) { | ||
config.headers = {}; | ||
} | ||
config.headers[headers_1.McmaHeaders.tracker] = core_1.Utils.toBase64(JSON.stringify(config.tracker)); | ||
delete config.tracker; | ||
} | ||
// try copying original headers so we can safely run the authentication signer multiple times | ||
let headers = config.headers; | ||
if (headers) { | ||
try { | ||
headers = JSON.parse(JSON.stringify(headers)); | ||
} | ||
catch (error) { | ||
console.log("HttpClient: Failed to copy headers due to:"); | ||
console.log(error); | ||
} | ||
} | ||
// send request using axios | ||
for (let attempts = 0; attempts < this.config.maxAttempts; attempts++) { | ||
try { | ||
config.headers = headers; | ||
if (this.authenticator) { | ||
await this.authenticator.sign(config); | ||
} | ||
return await axios_1.default(config); | ||
@@ -110,0 +125,0 @@ } |
{ | ||
"name": "@mcma/client", | ||
"version": "0.13.23", | ||
"version": "0.13.24", | ||
"description": "Node module with classes and functions used to access services in an MCMA environment", | ||
@@ -35,6 +35,6 @@ "engines": { | ||
"peerDependencies": { | ||
"@mcma/core": "0.13.23" | ||
"@mcma/core": "0.13.24" | ||
}, | ||
"devDependencies": { | ||
"@mcma/core": "0.13.23", | ||
"@mcma/core": "0.13.24", | ||
"@types/node": "^13.7.4", | ||
@@ -41,0 +41,0 @@ "jasmine": "^3.3.1" |
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
39506
864