Skip to content

Commit d3a11dd

Browse files
committed
Merge pull request #133 from doc-iwatersports/add-support-for-patch
Add support for http method PATCH
2 parents 93aec0b + 4974daf commit d3a11dd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/OAuth2Client/NXOAuth2Request.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ - (void)applyParameters:(NSDictionary *)someParameters onRequest:(NSMutableURLRe
157157
if (!someParameters) return;
158158

159159
NSString *httpMethod = [aRequest HTTPMethod];
160-
if ([httpMethod caseInsensitiveCompare:@"POST"] != NSOrderedSame
161-
&& [httpMethod caseInsensitiveCompare:@"PUT"] != NSOrderedSame) {
160+
if ([@[@"POST",@"PUT",@"PATCH"] containsObject: [httpMethod uppercaseString]]) {
162161
aRequest.URL = [aRequest.URL nxoauth2_URLByAddingParameters:someParameters];
163162
} else {
164163
NSInputStream *postBodyStream = [[NXOAuth2PostBodyStream alloc] initWithParameters:parameters];

0 commit comments

Comments
 (0)