Skip to content

Commit 69b17eb

Browse files
Allow semicolon in file name (#1991)
1 parent 44596ad commit 69b17eb

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,24 @@ - (void)testUnauthenticatedSimplePutData {
198198
[self waitForExpectations];
199199
}
200200

201+
- (void)testUnauthenticatedSimplePutSpecialCharacter {
202+
XCTestExpectation *expectation =
203+
[self expectationWithDescription:@"testUnauthenticatedSimplePutDataEscapedName"];
204+
FIRStorageReference *ref = [self.storage referenceWithPath:@"ios/public/-._~!$'()*,=:@&+;"];
205+
206+
NSData *data = [@"Hello World" dataUsingEncoding:NSUTF8StringEncoding];
207+
208+
[ref putData:data
209+
metadata:nil
210+
completion:^(FIRStorageMetadata *metadata, NSError *error) {
211+
XCTAssertNotNil(metadata, "Metadata should not be nil");
212+
XCTAssertNil(error, "Error should be nil");
213+
[expectation fulfill];
214+
}];
215+
216+
[self waitForExpectations];
217+
}
218+
201219
- (void)testUnauthenticatedSimplePutDataInBackgroundQueue {
202220
XCTestExpectation *expectation =
203221
[self expectationWithDescription:@"testUnauthenticatedSimplePutDataInBackgroundQueue"];

Firebase/Storage/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 3.0.3
22
- [changed] Storage operations can now be scheduled and controlled from any thread (#1302, #1388).
3+
- [fixed] Fixed an issue that prevented uploading of files whose names include semicolons.
34

45
# 3.0.2
56
- [changed] Migrate to use FirebaseAuthInterop interfaces to access FirebaseAuth (#1660).

Firebase/Storage/FIRStorageUtils.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030
#import "GTMSessionFetcher.h"
3131

32-
// This is the list at https://cloud.google.com/storage/docs/json_api/ without & and +.
32+
// This is the list at https://cloud.google.com/storage/docs/json_api/ without &, ; and +.
3333
NSString *const kGCSObjectAllowedCharacterSet =
34-
@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*,;=:@";
34+
@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*,=:@";
3535

3636
@implementation FIRStorageUtils
3737

0 commit comments

Comments
 (0)