File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -133,17 +133,21 @@ common.getPort = function(req) {
133
133
*/
134
134
135
135
common . urlJoin = function ( ) {
136
- var args = Array . prototype . slice . call ( arguments ) ;
137
-
138
- // We do not want to mess with the query string. All we want to touch is the path.
139
- var lastIndex = args . length - 1 ;
140
- var last = args [ lastIndex ]
141
- var lastSegs = last . split ( '?' )
142
- args [ lastIndex ] = lastSegs [ 0 ]
136
+ //
137
+ // We do not want to mess with the query string. All we want to touch is the path.
138
+ //
139
+ var args = Array . prototype . slice . call ( arguments ) ,
140
+ lastIndex = args . length - 1 ,
141
+ last = args [ lastIndex ] ,
142
+ lastSegs = last . split ( '?' ) ,
143
+ args [ lastIndex ] = lastSegs [ 0 ] ,
144
+ retSegs ;
143
145
146
+ //
144
147
// Join all strings, but remove empty strings so we don't get extra slashes from
145
148
// joining e.g. ['', 'am']
146
- var retSegs = [
149
+ //
150
+ retSegs = [
147
151
args . filter ( function filter ( a ) {
148
152
return ! ! a ;
149
153
} ) . join ( '/' ) . replace ( / \/ + / g, '/' )
You can’t perform that action at this time.
0 commit comments