npm-registry-client
Advanced tools
Comparing version 0.4.4 to 0.4.5
@@ -27,4 +27,3 @@ module.exports = adduser | ||
{ name : username | ||
, salt : salt | ||
, password_sha : sha(password + salt) | ||
, password : password | ||
, email : email | ||
@@ -55,3 +54,3 @@ , _id : 'org.couchdb.user:'+username | ||
var logObj = Object.keys(userobj).map(function (k) { | ||
if (k === 'salt' || k === 'password_sha') return [k, 'XXXXX'] | ||
if (k === 'password') return [k, 'XXXXX'] | ||
return [k, userobj[k]] | ||
@@ -58,0 +57,0 @@ }).reduce(function (s, kv) { |
module.exports = regRequest | ||
var url = require("url") | ||
, zlib = require("zlib") | ||
, fs = require("graceful-fs") | ||
@@ -131,2 +132,3 @@ , rm = require("rimraf") | ||
, method: method | ||
, encoding: null // tell request let body be Buffer instance | ||
, ca: this.conf.get('ca') | ||
@@ -144,2 +146,3 @@ , localAddress: this.conf.get('local-address') | ||
headers.accept = "application/json" | ||
headers['accept-encoding'] = 'gzip' | ||
@@ -175,3 +178,3 @@ headers["user-agent"] = this.conf.get('user-agent') || | ||
var done = requestDone.call(this, method, where, cb) | ||
var req = request(opts, done) | ||
var req = request(opts, decodeResponseBody(done)) | ||
@@ -188,2 +191,16 @@ req.on("error", cb) | ||
function decodeResponseBody(cb) { | ||
return function (er, response, data) { | ||
if (er) return cb(er, response, data) | ||
if (response.headers['content-encoding'] !== 'gzip') return cb(er, response, data) | ||
zlib.gunzip(data, function (er, buf) { | ||
if (er) return cb(er, response, data) | ||
cb(null, response, buf) | ||
}) | ||
} | ||
} | ||
// cb(er, parsed, raw, response) | ||
@@ -190,0 +207,0 @@ function requestDone (method, where, cb) { |
@@ -5,3 +5,3 @@ { | ||
"description": "Client for the npm registry", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "git://github.com/isaacs/npm-registry-client" |
@@ -35,5 +35,3 @@ var tap = require('tap') | ||
var o = JSON.parse(b) | ||
var salt = o.salt | ||
userdata.salt = salt | ||
userdata.password_sha = sha(password + salt) | ||
userdata.password = password | ||
userdata.date = o.date | ||
@@ -40,0 +38,0 @@ t.deepEqual(o, userdata) |
@@ -50,5 +50,3 @@ var tap = require('tap') | ||
var o = JSON.parse(b) | ||
var salt = o.salt | ||
userdata.salt = salt | ||
userdata.password_sha = sha(password + salt) | ||
userdata.password = password | ||
userdata.date = o.date | ||
@@ -55,0 +53,0 @@ t.deepEqual(o, userdata) |
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
75115
28
1257