Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Use http_old until http.js has https support
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 26, 2010
1 parent e2c940e commit d7f1521
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/utils/registry.js
Expand Up @@ -6,7 +6,7 @@ exports.tag = tag;
exports.adduser = adduser;

var npm = require("../../npm"),
http = require("http"),
http = require("http_old"),
url = require("url"),
log = require("./log"),
uuid = require("./uuid"),
Expand Down Expand Up @@ -70,7 +70,13 @@ function PUT (where, what, cb) {
if (ini.config.auth) {
headers.authorization = 'Basic ' + ini.config.auth;
}
log(sys.inspect(u), "registryPUT");
log(u.port || (u.protocol === "https:" ? 443 : 80), "registryPUT port");

var client = http.createClient(u.port || (u.protocol === "https:" ? 443 : 80), u.hostname);
if (u.protocol === "https:") {
client.setSecure("X509_PEM");
}
var request = client.request("PUT", u.pathname, headers);

log(sys.inspect(headers), "registryPUT headers");
Expand Down

0 comments on commit d7f1521

Please sign in to comment.