@@ -3937,7 +3937,7 @@ describe('File', () => {
39373937 const file = new File ( BUCKET , NAME ) ;
39383938 assert . strictEqual (
39393939 file . publicUrl ( ) ,
3940- `https://storage.googleapis.com/bucket-name/${ NAME } `
3940+ `https://storage.googleapis.com/bucket-name/${ encodeURIComponent ( NAME ) } `
39413941 ) ;
39423942 done ( ) ;
39433943 } ) ;
@@ -3947,7 +3947,7 @@ describe('File', () => {
39473947 const file = new File ( BUCKET , NAME ) ;
39483948 assert . strictEqual (
39493949 file . publicUrl ( ) ,
3950- `https://storage.googleapis.com/bucket-name/${ NAME } `
3950+ `https://storage.googleapis.com/bucket-name/${ encodeURIComponent ( NAME ) } `
39513951 ) ;
39523952 done ( ) ;
39533953 } ) ;
@@ -3957,7 +3957,7 @@ describe('File', () => {
39573957 const file = new File ( BUCKET , NAME ) ;
39583958 assert . strictEqual (
39593959 file . publicUrl ( ) ,
3960- `https://storage.googleapis.com/bucket-name/${ NAME } `
3960+ `https://storage.googleapis.com/bucket-name/${ encodeURIComponent ( NAME ) } `
39613961 ) ;
39623962 done ( ) ;
39633963 } ) ;
@@ -3967,7 +3967,17 @@ describe('File', () => {
39673967 const file = new File ( BUCKET , NAME ) ;
39683968 assert . strictEqual (
39693969 file . publicUrl ( ) ,
3970- `https://storage.googleapis.com/bucket-name/${ NAME } `
3970+ `https://storage.googleapis.com/bucket-name/${ encodeURIComponent ( NAME ) } `
3971+ ) ;
3972+ done ( ) ;
3973+ } ) ;
3974+
3975+ it ( 'with an ampersand in the name' , done => {
3976+ const NAME = '&foo' ;
3977+ const file = new File ( BUCKET , NAME ) ;
3978+ assert . strictEqual (
3979+ file . publicUrl ( ) ,
3980+ `https://storage.googleapis.com/bucket-name/${ encodeURIComponent ( NAME ) } `
39713981 ) ;
39723982 done ( ) ;
39733983 } ) ;
0 commit comments