Skip to content

Commit 89c38d1

Browse files
authored
Use nil to clear customMetadata (#9870)
1 parent 1658c40 commit 89c38d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

FirebaseStorageInternal/Tests/Integration/FIRStorageIntegrationTests.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,19 +654,20 @@ - (void)testUpdateMetadata {
654654
// "a" is now deleted and the empty string for "y" remains.
655655
customMetadata:@{@"c" : @"d", @"y" : @""}];
656656

657-
// Clear all metadata.
657+
// Clear all metadata with nils.
658658
FIRStorageMetadata *metadata = updatedMetadata;
659659
metadata.cacheControl = nil;
660660
metadata.contentDisposition = nil;
661661
metadata.contentEncoding = nil;
662662
metadata.contentLanguage = nil;
663663
metadata.contentType = nil;
664-
metadata.customMetadata = [NSDictionary dictionary];
664+
metadata.customMetadata = nil;
665665

666666
[ref updateMetadata:metadata
667667
completion:^(FIRStorageMetadata *updatedMetadata, NSError *error) {
668668
XCTAssertNil(error);
669669
[self assertMetadataNil:updatedMetadata];
670+
XCTAssertNil(updatedMetadata.customMetadata);
670671
[expectation fulfill];
671672
}];
672673
}];

0 commit comments

Comments
 (0)