Comparing version 5.0.2 to 5.1.0
@@ -7,3 +7,3 @@ /// <reference types="node" /> | ||
export declare const deps: { | ||
readonly proxy: typeof proxy.ProxyUtil; | ||
readonly proxy: typeof proxy.default; | ||
readonly isStream: any; | ||
@@ -10,0 +10,0 @@ readonly contentType: typeof contentType; |
@@ -57,2 +57,4 @@ "use strict"; | ||
constructor(url, options = {}) { | ||
this._redirectRetries = 0; | ||
this._errorRetries = 0; | ||
const userAgent = (global['http-call'] && global['http-call'].userAgent && global['http-call'].userAgent) || | ||
@@ -230,4 +232,2 @@ `${pjson.name}/${pjson.version} node-${process.version}`; | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
if (!this._redirectRetries) | ||
this._redirectRetries = 0; | ||
this._redirectRetries++; | ||
@@ -250,4 +250,2 @@ if (this._redirectRetries > 10) | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
if (!this._errorRetries) | ||
this._errorRetries = 0; | ||
this._errorRetries++; | ||
@@ -295,2 +293,8 @@ const allowed = (err) => { | ||
} | ||
if (this.options.timeout) { | ||
this.request.setTimeout(this.options.timeout, () => { | ||
debug(`<-- ${this.method} ${this.url} TIMED OUT`); | ||
this.request.abort(); | ||
}); | ||
} | ||
this.request.on('error', reject); | ||
@@ -297,0 +301,0 @@ if (this.options.body && deps_1.deps.isStream.readable(this.options.body)) { |
{ | ||
"name": "http-call", | ||
"description": "make http requests", | ||
"version": "5.0.2", | ||
"version": "5.1.0", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -12,25 +12,20 @@ "bugs": "https://github.com/heroku/http-call/issues", | ||
"is-stream": "^1.1.0", | ||
"tslib": "^1.8.1", | ||
"tslib": "^1.9.0", | ||
"tunnel-agent": "^0.6.0" | ||
}, | ||
"devDependencies": { | ||
"@cli-engine/util": "^1.0.13", | ||
"@heroku-cli/tslint": "^1.1.2", | ||
"@heroku-cli/tslint": "^1.1.4", | ||
"@types/content-type": "1.1.2", | ||
"@types/is-stream": "^1.1.0", | ||
"@types/jest": "^22.0.1", | ||
"@types/nock": "^9.1.1", | ||
"@types/node": "^9.3.0", | ||
"del-cli": "^1.1.0", | ||
"husky": "^0.14.3", | ||
"jest": "^22.0.4", | ||
"nock": "^9.1.5", | ||
"prettier": "^1.9.2", | ||
"standard": "^10.0.3", | ||
"ts-jest": "^22.0.1", | ||
"tslint": "^5.8.0", | ||
"typescript": "^2.6.2" | ||
"@types/jest": "^22.2.2", | ||
"@types/nock": "^9.1.2", | ||
"@types/node": "^9.6.0", | ||
"jest": "^22.4.3", | ||
"nock": "^9.2.3", | ||
"ts-jest": "^22.4.2", | ||
"tslint": "^5.9.1", | ||
"typescript": "^2.7.2" | ||
}, | ||
"engines": { | ||
"node": ">=6.0.0" | ||
"node": ">=8.0.0" | ||
}, | ||
@@ -50,5 +45,3 @@ "files": [ | ||
"scripts": { | ||
"posttest": "cli-engine-util", | ||
"precommit": "cli-engine-util", | ||
"prepare": "cli-engine-util", | ||
"prepare": "rm -rf lib && tsc", | ||
"pretest": "tsc", | ||
@@ -55,0 +48,0 @@ "test": "jest" |
@@ -0,3 +1,15 @@ | ||
http-call | ||
========= | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/heroku/http-call.svg)](https://greenkeeper.io/) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/heroku/http-call.svg)](https://greenkeeper.io/) | ||
Usage | ||
----- | ||
```js | ||
const {HTTP} = require('http-call') | ||
const {body} = await HTTP.get('https://api.github.com') | ||
// set headers | ||
await HTTP.get('https://api.github.com', {headers: {authorization: 'bearer auth'}}) | ||
``` |
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
39560
11
12
1033
16
Updatedtslib@^1.9.0