Skip to content

Commit

Permalink
Update intercept.js
Browse files Browse the repository at this point in the history
  • Loading branch information
facundoolano committed Sep 8, 2013
1 parent 4fe1226 commit 0b95520
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/intercept.js
Expand Up @@ -121,8 +121,10 @@ function removeAll() {
function normalizeForRequest(options) {
options.proto = options.proto || 'http';
options.port = options.port || ((options.proto === 'http') ? 80 : 443);
options.hostname = options.hostname || options.host.split(':')[0];
options.host = options.hostname + ':' + options.port;
if (options.host) {
options.hostname = options.hostname || options.host.split(':')[0];
}
options.host = (options.hostname || 'localhost') + ':' + options.port;

return options;
}
Expand All @@ -138,7 +140,7 @@ function interceptorsFor(options) {
}


function activate() {
function activate() n{
// ----- Extending http.ClientRequest

function OverridenClientRequest(options, cb) {
Expand Down Expand Up @@ -219,4 +221,4 @@ module.exports.removeAll = removeAll;
module.exports.isOn = isOn;
module.exports.activate = activate;
module.exports.enableNetConnect = enableNetConnect;
module.exports.disableNetConnect = disableNetConnect;
module.exports.disableNetConnect = disableNetConnect;

0 comments on commit 0b95520

Please sign in to comment.