Comparing version 3.0.1 to 3.0.2
@@ -47,2 +47,5 @@ 'use strict'; | ||
const debugHeaders = require('debug')('http:headers'); | ||
const debugBody = require('debug')('http:body'); | ||
function concat(stream) { | ||
@@ -275,2 +278,3 @@ return new Promise(resolve => { | ||
} catch (err) { | ||
debug(err); | ||
return this._maybeRetry(err); | ||
@@ -307,3 +311,3 @@ } | ||
let noise = Math.random() * 100; | ||
await this._wait((1 << this._errorRetries) * 1000 + noise); | ||
await this._wait((1 << this._errorRetries) * 100 + noise); | ||
await this._request(); | ||
@@ -317,11 +321,11 @@ return; | ||
if (this.options.agent) debug('proxy: %o', this.options.agent.options); | ||
debug('--> %s %s %O', this.options.method, this.url, this._redactedHeaders(this.options.headers)); | ||
debug('--> %s %s', this.options.method, this.url); | ||
debugHeaders(this._redactedHeaders(this.options.headers)); | ||
if (this.options.body) debugBody(this.options.body); | ||
} | ||
_debugResponse() { | ||
if (this.body) { | ||
debug('<-- %s %s %s\nHeaders: %O\nBody: %O', this.method, this.url, this.statusCode, this._redactedHeaders(this.headers), this.body); | ||
} else { | ||
debug('<-- %s %s %s\nHeaders: %O\nBody: %O', this.method, this.url, this.statusCode, this._redactedHeaders(this.headers), this.body); | ||
} | ||
debug('<-- %s %s %s', this.method, this.url, this.statusCode); | ||
debugHeaders(this._redactedHeaders(this.headers)); | ||
if (this.body) debugBody(this.body); | ||
} | ||
@@ -328,0 +332,0 @@ |
{ | ||
"name": "http-call", | ||
"description": "make http requests", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"author": "Jeff Dickey @dickeyxxx", | ||
@@ -17,3 +17,3 @@ "bugs": "https://github.com/dickeyxxx/http-call/issues", | ||
"babel-eslint": "7.2.3", | ||
"babel-jest": "20.0.3", | ||
"babel-jest": "^21.0.0", | ||
"babel-plugin-syntax-object-rest-spread": "^6.13.0", | ||
@@ -26,3 +26,3 @@ "babel-plugin-transform-class-properties": "6.24.1", | ||
"flow-typed": "^2.1.5", | ||
"jest": "20.0.4", | ||
"jest": "^21.0.1", | ||
"jsdoc-babel": "0.3.0", | ||
@@ -29,0 +29,0 @@ "jsdoc-to-markdown": "3.0.0", |
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
448
29502