Skip to content

Commit 3836e8e

Browse files
committed
Do not throw for path containing ..
1 parent f825b1d commit 3836e8e

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

packages/storage/src/service.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ function refFromPath(
7474
} else {
7575
// ref is a Reference
7676
if (path !== undefined) {
77-
if (path.includes('..')) {
78-
throw invalidArgument('`path` param cannot contain ".."');
79-
}
8077
return _getChild(ref, path);
8178
} else {
8279
return ref;

packages/storage/test/unit/service.exp.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,6 @@ GOOG4-RSA-SHA256`
372372
const newRef = ref(reference);
373373
expect(newRef.toString()).to.equal('gs://bucket/object');
374374
});
375-
it('Throws calling ref(reference, path) if path contains ".."', () => {
376-
const error = testShared.assertThrows(() => {
377-
ref(reference, `../child/path`);
378-
}, 'storage/invalid-argument');
379-
expect(error.message).to.match(/"\.\."/);
380-
});
381375
});
382376

383377
describe('Deletion', () => {

0 commit comments

Comments
 (0)