conjure-client
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -35,5 +35,5 @@ /** | ||
private fetchInternal; | ||
private getRetryAfterHeaderValue; | ||
private getRetryAfterHeaderValueInMilliseconds; | ||
private getRetryAfter; | ||
private doAttempt; | ||
} |
@@ -94,3 +94,3 @@ "use strict"; | ||
}; | ||
RetryingFetch.prototype.getRetryAfterHeaderValue = function (response) { | ||
RetryingFetch.prototype.getRetryAfterHeaderValueInMilliseconds = function (response) { | ||
var retryAfterHeader = response.headers.get("Retry-After"); | ||
@@ -100,10 +100,11 @@ if (retryAfterHeader == null) { | ||
} | ||
var retryAfter = parseInt(retryAfterHeader, 10); | ||
if (isNaN(retryAfter)) { | ||
var retryAfterInSeconds = parseInt(retryAfterHeader, 10); | ||
if (isNaN(retryAfterInSeconds)) { | ||
return undefined; | ||
} | ||
if (retryAfter < 0 || retryAfter > MAX_RETRY_AFTER_MS) { | ||
var retryAfterInMilliseconds = retryAfterInSeconds * 1000; | ||
if (retryAfterInMilliseconds < 0 || retryAfterInMilliseconds > MAX_RETRY_AFTER_MS) { | ||
return undefined; | ||
} | ||
return retryAfter; | ||
return retryAfterInMilliseconds; | ||
}; | ||
@@ -116,3 +117,3 @@ RetryingFetch.prototype.getRetryAfter = function (response, attempt) { | ||
} | ||
var retryAfterFromHeader = this.getRetryAfterHeaderValue(response); | ||
var retryAfterFromHeader = this.getRetryAfterHeaderValueInMilliseconds(response); | ||
if (retryAfterFromHeader !== undefined) { | ||
@@ -119,0 +120,0 @@ return retryAfterFromHeader; |
{ | ||
"name": "conjure-client", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "An HTTP bridge library for use in front end applications and generated conjure code", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -65,3 +65,3 @@ /** | ||
private getRetryAfterHeaderValue(response: IFetchResponse): number | undefined { | ||
private getRetryAfterHeaderValueInMilliseconds(response: IFetchResponse): number | undefined { | ||
const retryAfterHeader = response.headers.get("Retry-After"); | ||
@@ -72,12 +72,13 @@ if (retryAfterHeader == null) { | ||
const retryAfter = parseInt(retryAfterHeader, 10); | ||
if (isNaN(retryAfter)) { | ||
const retryAfterInSeconds = parseInt(retryAfterHeader, 10); | ||
if (isNaN(retryAfterInSeconds)) { | ||
return undefined; | ||
} | ||
if (retryAfter < 0 || retryAfter > MAX_RETRY_AFTER_MS) { | ||
const retryAfterInMilliseconds = retryAfterInSeconds * 1000; | ||
if (retryAfterInMilliseconds < 0 || retryAfterInMilliseconds > MAX_RETRY_AFTER_MS) { | ||
return undefined; | ||
} | ||
return retryAfter; | ||
return retryAfterInMilliseconds; | ||
} | ||
@@ -92,3 +93,3 @@ | ||
const retryAfterFromHeader = this.getRetryAfterHeaderValue(response); | ||
const retryAfterFromHeader = this.getRetryAfterHeaderValueInMilliseconds(response); | ||
if (retryAfterFromHeader !== undefined) { | ||
@@ -95,0 +96,0 @@ return retryAfterFromHeader; |
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
72764
1409