File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export class Location {
93
93
94
94
const cloudStorageHost =
95
95
'(?:storage.googleapis.com|storage.cloud.google.com)' ;
96
- const cloudStoragePath = '([^?]*)' ;
96
+ const cloudStoragePath = '([^?# ]*)' ;
97
97
const cloudStorageRegExp = new RegExp (
98
98
`^https?://${ cloudStorageHost } /${ bucketDomain } /${ cloudStoragePath } ` ,
99
99
'i'
Original file line number Diff line number Diff line change @@ -201,6 +201,12 @@ GOOG4-RSA-SHA256`
201
201
) ;
202
202
assert . equal ( ref . toString ( ) , 'gs://mybucket/path with space/image.png' ) ;
203
203
} ) ;
204
+ it ( 'Works with storage.cloud.google.com URLs and escaped slash' , ( ) => {
205
+ const ref = service . refFromURL (
206
+ `https://storage.cloud.google.com/mybucket/path%20with%20space%2Fimage.png`
207
+ ) ;
208
+ assert . equal ( ref . toString ( ) , 'gs://mybucket/path with space/image.png' ) ;
209
+ } ) ;
204
210
} ) ;
205
211
describe ( 'Argument verification' , ( ) => {
206
212
const service = new Service (
You can’t perform that action at this time.
0 commit comments