Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Closes GH-726 Put port on hostname.

  • Loading branch information...
commit b8698c5f399b0e28fb2db7560a786aedce9dce9e 1 parent 0ab84bf
@isaacs isaacs authored
View
1  lib/utils/fetch.js
@@ -57,6 +57,7 @@ function fetchAndWrite (remote, fstr, headers, maxRedirects, redirects) {
, agent: false
}
if (!opts.port) opts.port = opts.secure ? 443 : 80
+ if (opts.port !== (opts.secure ? 443 : 80)) opts.host += ":" + opts.port
opts = proxyify(npm.config.get("proxy"), remote, opts)
if (!opts) return cb(new Error("Bad proxy config: "+npm.config.get("proxy")))
View
4 lib/utils/proxyify.js
@@ -32,6 +32,10 @@ function proxyify (proxyConfig, remote, opts) {
:proxy.protocol === "https:" ? 443
:80)
+ if (opts.port !== (proxy.protocol === "https:" ? 443 : 80)) {
+ opts.host += ":" + proxy.port
+ }
+
if (typeof remote === "string") remote = url.parse(remote)
if (remote.auth) {
headers.authorization = (new Buffer(remote.auth).toString("base64"))
View
1  lib/utils/registry/request.js
@@ -66,6 +66,7 @@ function request (method, where, what, etag, nofollow, cb_) {
, auth = authRequired && npm.config.get("_auth")
log.verbose(remote, "url parsed "+where)
+ if (port !== (secure ? 443 : 80)) hostname += ":" + port
if (authRequired && !auth) {
return cb(new Error(
Please sign in to comment.
Something went wrong with that request. Please try again.