aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-08-12 17:33:23 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-08-12 20:34:19 -0700
commit6512d26b1b9bb70724437cb103f1df4b8ef5020c (patch)
treebcfd5b479fcc64a7b18c102b30a638f3d88fe2fc /src/objective-c
parent2d1e5a1b2611398faa85e355f6fd2f06b2239805 (diff)
Rename requestMetadata -> requestHeaders
Diffstat (limited to 'src/objective-c')
-rw-r--r--src/objective-c/GRPCClient/GRPCCall+OAuth2.m6
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.h4
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m14
3 files changed, 12 insertions, 12 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall+OAuth2.m b/src/objective-c/GRPCClient/GRPCCall+OAuth2.m
index ed39d4b0f7..8e64b8b6ae 100644
--- a/src/objective-c/GRPCClient/GRPCCall+OAuth2.m
+++ b/src/objective-c/GRPCClient/GRPCCall+OAuth2.m
@@ -40,7 +40,7 @@ static NSString * const kChallengeHeader = @"www-authenticate";
@implementation GRPCCall (OAuth2)
- (NSString *)oauth2AccessToken {
- NSString *headerValue = self.requestMetadata[kAuthorizationHeader];
+ NSString *headerValue = self.requestHeaders[kAuthorizationHeader];
if ([headerValue hasPrefix:kBearerPrefix]) {
return [headerValue substringFromIndex:kBearerPrefix.length];
} else {
@@ -50,9 +50,9 @@ static NSString * const kChallengeHeader = @"www-authenticate";
- (void)setOauth2AccessToken:(NSString *)token {
if (token) {
- self.requestMetadata[kAuthorizationHeader] = [kBearerPrefix stringByAppendingString:token];
+ self.requestHeaders[kAuthorizationHeader] = [kBearerPrefix stringByAppendingString:token];
} else {
- [self.requestMetadata removeObjectForKey:kAuthorizationHeader];
+ [self.requestHeaders removeObjectForKey:kAuthorizationHeader];
}
}
diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h
index 4a8b7fff48..97324cba15 100644
--- a/src/objective-c/GRPCClient/GRPCCall.h
+++ b/src/objective-c/GRPCClient/GRPCCall.h
@@ -68,8 +68,8 @@ extern id const kGRPCStatusMetadataKey;
//
// For convenience, the property is initialized to an empty NSMutableDictionary, and the setter
// accepts (and copies) both mutable and immutable dictionaries.
-- (NSMutableDictionary *)requestMetadata; // nonatomic
-- (void)setRequestMetadata:(NSDictionary *)requestMetadata; // nonatomic, copy
+- (NSMutableDictionary *)requestHeaders; // nonatomic
+- (void)setRequestHeaders:(NSDictionary *)requestHeaders; // nonatomic, copy
// This dictionary is populated with the HTTP headers received from the server. When the RPC ends,
// the HTTP trailers received are added to the dictionary too. It has the same structure as the
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index 0f4c811ce4..1065ae735f 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -89,7 +89,7 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
// the response arrives.
GRPCCall *_retainSelf;
- NSMutableDictionary *_requestMetadata;
+ NSMutableDictionary *_requestHeaders;
NSMutableDictionary *_responseMetadata;
}
@@ -121,7 +121,7 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
_requestWriter = requestWriter;
- _requestMetadata = [NSMutableDictionary dictionary];
+ _requestHeaders = [NSMutableDictionary dictionary];
_responseMetadata = [NSMutableDictionary dictionary];
}
return self;
@@ -129,12 +129,12 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
#pragma mark Metadata
-- (NSMutableDictionary *)requestMetadata {
- return _requestMetadata;
+- (NSMutableDictionary *)requestHeaders {
+ return _requestHeaders;
}
-- (void)setRequestMetadata:(NSDictionary *)requestMetadata {
- _requestMetadata = [NSMutableDictionary dictionaryWithDictionary:requestMetadata];
+- (void)setRequestHeaders:(NSDictionary *)requestHeaders {
+ _requestHeaders = [NSMutableDictionary dictionaryWithDictionary:requestHeaders];
}
- (NSDictionary *)responseMetadata {
@@ -356,7 +356,7 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
_retainSelf = self;
_responseWriteable = [[GRXConcurrentWriteable alloc] initWithWriteable:writeable];
- [self sendHeaders:_requestMetadata];
+ [self sendHeaders:_requestHeaders];
[self invokeCall];
}