Skip to content

Allow semicolon in file name #1991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,24 @@ - (void)testUnauthenticatedSimplePutData {
[self waitForExpectations];
}

- (void)testUnauthenticatedSimplePutSpecialCharacter {
XCTestExpectation *expectation =
[self expectationWithDescription:@"testUnauthenticatedSimplePutDataEscapedName"];
FIRStorageReference *ref = [self.storage referenceWithPath:@"ios/public/-._~!$'()*,=:@&+;"];

NSData *data = [@"Hello World" dataUsingEncoding:NSUTF8StringEncoding];

[ref putData:data
metadata:nil
completion:^(FIRStorageMetadata *metadata, NSError *error) {
XCTAssertNotNil(metadata, "Metadata should not be nil");
XCTAssertNil(error, "Error should be nil");
[expectation fulfill];
}];

[self waitForExpectations];
}

- (void)testUnauthenticatedSimplePutDataInBackgroundQueue {
XCTestExpectation *expectation =
[self expectationWithDescription:@"testUnauthenticatedSimplePutDataInBackgroundQueue"];
Expand Down
1 change: 1 addition & 0 deletions Firebase/Storage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 3.0.2
- [changed] Storage operations can now be scheduled and controlled from any thread (#1302, #1388).
- [fixed] Fixed an issue that prevented uploading of files whose names include semicolons.

# v3.0.1
- [fixed] Fixed potential `EXC_BAD_ACCESS` violation in the internal logic for processing finished downloads (#1565, #1747).
Expand Down
4 changes: 2 additions & 2 deletions Firebase/Storage/FIRStorageUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

#import "GTMSessionFetcher.h"

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

@implementation FIRStorageUtils

Expand Down