Skip to content
Snippets Groups Projects
Commit 62b9305e authored by Michael Lumish's avatar Michael Lumish
Browse files

Merge pull request #3219 from jcanizales/dont-strip-bin

Don’t strip -bin suffix from response metadata.
parents 09f56917 34667063
Branches
Tags
No related merge requests found
...@@ -89,8 +89,6 @@ ...@@ -89,8 +89,6 @@
+ (instancetype)grpc_dictionaryFromMetadata:(grpc_metadata *)entries count:(size_t)count { + (instancetype)grpc_dictionaryFromMetadata:(grpc_metadata *)entries count:(size_t)count {
NSMutableDictionary *metadata = [NSMutableDictionary dictionaryWithCapacity:count]; NSMutableDictionary *metadata = [NSMutableDictionary dictionaryWithCapacity:count];
for (grpc_metadata *entry = entries; entry < entries + count; entry++) { for (grpc_metadata *entry = entries; entry < entries + count; entry++) {
// TODO(jcanizales): Verify in a C library test that it's converting header names to lower case
// automatically.
NSString *name = [NSString stringWithCString:entry->key encoding:NSASCIIStringEncoding]; NSString *name = [NSString stringWithCString:entry->key encoding:NSASCIIStringEncoding];
if (!name || metadata[name]) { if (!name || metadata[name]) {
// Log if name is nil? // Log if name is nil?
...@@ -98,7 +96,6 @@ ...@@ -98,7 +96,6 @@
} }
id value; id value;
if ([name hasSuffix:@"-bin"]) { if ([name hasSuffix:@"-bin"]) {
name = [name substringToIndex:name.length - 4];
value = [NSData grpc_dataFromMetadataValue:entry]; value = [NSData grpc_dataFromMetadataValue:entry];
} else { } else {
value = [NSString grpc_stringFromMetadataValue:entry]; value = [NSString grpc_stringFromMetadataValue:entry];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment