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