@@ -16,31 +16,41 @@ Job.prototype = {
1616
1717 combineUrls : function ( parentUrl , childUrl ) {
1818
19- var urlMatcher = new RegExp ( "(https?://)?([a-z0-9\\-\\.]+\\.[a-z0-9\\-]+|\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3})?(\\/[^\\?]*\\/|\\/)?([^\\?]*)?(\\?.*)?" , "i" ) ;
19+ var urlMatcher = new RegExp ( "(https?://)?([a-z0-9\\-\\.]+\\.[a-z0-9\\-]+(:\\d+)? |\\d{1,3}\\ .\\d{1,3}\\ .\\d{1,3}\\ .\\d{1,3}(:\\d+)? )?(\\/[^\\?]*\\/|\\/)?([^\\?]*)?(\\?.*)?" , "i" ) ;
2020
2121 var parentMatches = parentUrl . match ( urlMatcher ) ;
2222 var childMatches = childUrl . match ( urlMatcher ) ;
2323
2424 // special case for urls like this: ?a=1 or like-this/
25- if ( childMatches [ 1 ] === undefined && childMatches [ 2 ] === undefined && childMatches [ 3 ] === undefined && childMatches [ 4 ] === undefined ) {
25+ if ( childMatches [ 1 ] === undefined && childMatches [ 2 ] === undefined && childMatches [ 5 ] === undefined && childMatches [ 6 ] === undefined ) {
2626
27- var url = parentMatches [ 1 ] + parentMatches [ 2 ] + parentMatches [ 3 ] + parentMatches [ 4 ] + childMatches [ 5 ] ;
27+ var url = parentMatches [ 1 ] + parentMatches [ 2 ] + parentMatches [ 5 ] + parentMatches [ 6 ] + childMatches [ 7 ] ;
2828 return url ;
2929 }
3030
31- for ( var i = 1 ; i <= 3 ; i ++ ) {
32- if ( childMatches [ i ] === undefined ) {
33- childMatches [ i ] = parentMatches [ i ] ;
34- }
31+ if ( childMatches [ 1 ] === undefined ) {
32+ childMatches [ 1 ] = parentMatches [ 1 ] ;
3533 }
36- if ( childMatches [ 4 ] === undefined ) {
37- childMatches [ 4 ] = "" ;
34+ if ( childMatches [ 2 ] === undefined ) {
35+ childMatches [ 2 ] = parentMatches [ 2 ] ;
3836 }
3937 if ( childMatches [ 5 ] === undefined ) {
40- childMatches [ 5 ] = "" ;
38+ if ( parentMatches [ 5 ] === undefined ) {
39+ childMatches [ 5 ] = '/' ;
40+ }
41+ else {
42+ childMatches [ 5 ] = parentMatches [ 5 ] ;
43+ }
44+ }
45+
46+ if ( childMatches [ 6 ] === undefined ) {
47+ childMatches [ 6 ] = "" ;
48+ }
49+ if ( childMatches [ 7 ] === undefined ) {
50+ childMatches [ 7 ] = "" ;
4151 }
4252
43- return childMatches [ 1 ] + childMatches [ 2 ] + childMatches [ 3 ] + childMatches [ 4 ] + childMatches [ 5 ] ;
53+ return childMatches [ 1 ] + childMatches [ 2 ] + childMatches [ 5 ] + childMatches [ 6 ] + childMatches [ 7 ] ;
4454 } ,
4555
4656 execute : function ( browser , callback , scope ) {
0 commit comments