Skip to content

Commit

Permalink
fix: debug on requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Drukh authored and michael-go committed Feb 27, 2018
1 parent 6847700 commit 5bf0f83
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/request/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module.exports = makeRequest;

var debug = require('debug')('snyk:req');
var snykDebug = require('debug')('snyk');
var Promise = require('es6-promise').Promise; // jshint ignore:line
var needle = require('needle');
var stream = require('stream');
Expand All @@ -28,7 +29,8 @@ function makeRequest(payload) {
bodyStream.push(null);
bodyStream = bodyStream.pipe(zlib.createGzip());

debug('compressing body (%s)', json.length);
snykDebug('sending request to:', payload.url);
snykDebug('request body size:', json.length);
if (json.length < 1e4) {
debug(JSON.stringify(body, '', 2));
}
Expand Down Expand Up @@ -72,8 +74,10 @@ function makeRequest(payload) {

var proxy = getProxyForUrl(url);
if (proxy) {
debug('Using proxy: ', proxy);
snykDebug('Using proxy: ', proxy);
options.proxy = proxy;
} else {
snykDebug('Not using proxy');
}

if (global.ignoreUnknownCA) {
Expand Down

0 comments on commit 5bf0f83

Please sign in to comment.