good-guy-http
Advanced tools
Comparing version 1.12.0 to 1.12.1
@@ -26,2 +26,3 @@ var _ = require('underscore'); | ||
errorLogger: console.error, // error logs will go to stderr | ||
logTiming: false, // log timing info to the console | ||
@@ -74,3 +75,3 @@ // if the server doesn't specify Cache-Control, default cache setup is caching for 5s | ||
'requestLib', | ||
'logTiming', | ||
'mockTimer', | ||
@@ -103,2 +104,6 @@ 'idempotent' | ||
// Set up timing | ||
if (config.logTiming) | ||
reqConfig.time = true; | ||
// sanitize configuration | ||
@@ -126,3 +131,3 @@ if (config.cache === undefined) | ||
// we obviously aren't allowed to retry POST's and other non-idempotent requests | ||
var fetch = require('./promised-request')(request, Promise, _.pick(config, ['maxResponseSize'])); | ||
var fetch = require('./promised-request')(request, Promise, _.pick(config, ['maxResponseSize', 'logTiming'])); | ||
var fetchIdempotent = fetch, fetchNonIdempotent = fetch; | ||
@@ -129,0 +134,0 @@ if (config.maxRetries) |
@@ -30,2 +30,9 @@ var util = require('util'); | ||
var httpReq = request(requestOptions, function(err, response) { | ||
if (config.logTiming) console.log('Timing: url: ' + response.request.uri.href | ||
+ ' total: ' + response.timingPhases.total | ||
+ ' wait: ' + response.timingPhases.wait | ||
+ ' dns: ' + response.timingPhases.dns | ||
+ ' tcp: ' + response.timingPhases.tcp | ||
+ ' firstByte: ' + response.timingPhases.firstByte | ||
+ ' download: ' + response.timingPhases.download); | ||
// hard errors cause a promise rejection | ||
@@ -32,0 +39,0 @@ if (err) { |
{ | ||
"name": "good-guy-http", | ||
"version": "1.12.0", | ||
"version": "1.12.1", | ||
"description": "The opinionated sane HTTP client with a good guy approach.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
95801
2229
3