From 6512d26b1b9bb70724437cb103f1df4b8ef5020c Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Wed, 12 Aug 2015 17:33:23 -0700 Subject: [PATCH] Rename requestMetadata -> requestHeaders --- src/objective-c/GRPCClient/GRPCCall+OAuth2.m | 6 +++--- src/objective-c/GRPCClient/GRPCCall.h | 4 ++-- src/objective-c/GRPCClient/GRPCCall.m | 14 +++++++------- 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 ed39d4b0f7a..8e64b8b6ae5 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 4a8b7fff486..97324cba153 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 0f4c811ce41..1065ae735f5 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]; }