File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const path = require('path');
66 * e.g. from \path\to\res.js to /path/to/res.js.
77 */
88module . exports = function ( publicURL , assetPath ) {
9- const url = URL . parse ( publicURL ) ;
9+ const url = URL . parse ( publicURL , false , true ) ;
1010 url . pathname = path . posix . join ( url . pathname , URL . parse ( assetPath ) . pathname ) ;
1111 return URL . format ( url ) ;
1212} ;
Original file line number Diff line number Diff line change @@ -64,4 +64,11 @@ describe('Url Join', () => {
6464 it ( 'should support windows paths' , ( ) => {
6565 assert . equal ( urlJoin ( 'dist\\foo' , '\\bar\\foo.js' ) , 'dist/foo/bar/foo.js' ) ;
6666 } ) ;
67+
68+ it ( 'should parse double slashes as host' , ( ) => {
69+ assert . equal (
70+ urlJoin ( '//parceljs.org/foo?a=123&b=456#hello' , 'bar/a.js' ) ,
71+ '//parceljs.org/foo/bar/a.js?a=123&b=456#hello'
72+ ) ;
73+ } ) ;
6774} ) ;
You canāt perform that action at this time.
0 commit comments