Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

conjure-client

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conjure-client - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

2

lib/fetchBridge/retryingFetch.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc