File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ UrlResolver.prototype._resolve = function () {
105
105
// -----------------
106
106
107
107
UrlResolver . prototype . _download = function ( ) {
108
- var file = path . join ( this . _tempDir , path . basename ( this . _source ) ) ;
108
+ var fileName = url . parse ( path . basename ( this . _source ) ) . pathname ;
109
+ var file = path . join ( this . _tempDir , fileName ) ;
109
110
var reqHeaders = { } ;
110
111
var that = this ;
111
112
Original file line number Diff line number Diff line change @@ -568,6 +568,32 @@ describe('UrlResolver', function () {
568
568
. done ( ) ;
569
569
} ) ;
570
570
571
+ it ( 'should allow for query strings in URL' , function ( next ) {
572
+ var resolver ;
573
+
574
+ nock ( 'http://bower.io' )
575
+ . get ( '/foo.js?bar=baz' )
576
+ . reply ( 200 , 'foo contents' ) ;
577
+
578
+ resolver = create ( 'http://bower.io/foo.js?bar=baz' ) ;
579
+
580
+ resolver . resolve ( )
581
+ . then ( function ( dir ) {
582
+ var contents ;
583
+
584
+ expect ( fs . existsSync ( path . join ( dir , 'index.js' ) ) ) . to . be ( true ) ;
585
+ expect ( fs . existsSync ( path . join ( dir , 'foo.js' ) ) ) . to . be ( false ) ;
586
+ expect ( fs . existsSync ( path . join ( dir , 'foo.js?bar=baz' ) ) ) . to . be ( false ) ;
587
+
588
+ contents = fs . readFileSync ( path . join ( dir , 'index.js' ) ) . toString ( ) ;
589
+ expect ( contents ) . to . equal ( 'foo contents' ) ;
590
+
591
+ assertMain ( dir , 'index.js' )
592
+ . then ( next . bind ( next , null ) ) ;
593
+ } )
594
+ . done ( ) ;
595
+ } ) ;
596
+
571
597
it ( 'should save cache headers' , function ( next ) {
572
598
var resolver ;
573
599
You can’t perform that action at this time.
0 commit comments