Skip to content
Permalink
Browse files

[fix] style changes

  • Loading branch information...
jcrugzz committed Nov 11, 2014
1 parent eb95660 commit 33c0d664b617dc44530d86d60fc71eb0b99bec84
Showing with 15 additions and 11 deletions.
  1. +15 −11 lib/http-proxy/common.js
@@ -133,19 +133,23 @@ common.getPort = function(req) {
*/

common.urlJoin = function() {
var args = Array.prototype.slice.call(arguments);

// We do not want to mess with the query string. All we want to touch is the path.
var lastIndex = args.length-1;
var last = args[lastIndex]
var lastSegs = last.split('?')
args[lastIndex] = lastSegs[0]

//
// We do not want to mess with the query string. All we want to touch is the path.
//
var args = Array.prototype.slice.call(arguments),
lastIndex = args.length - 1,
last = args[lastIndex],
lastSegs = last.split('?'),
args[lastIndex] = lastSegs[0],
retSegs;

//
// Join all strings, but remove empty strings so we don't get extra slashes from
// joining e.g. ['', 'am']
var retSegs = [
args.filter(function filter(a) {
return !!a;
//
retSegs = [
args.filter(function filter(a) {
return !!a;
}).join('/').replace(/\/+/g, '/')
];

0 comments on commit 33c0d66

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.