Skip to content

Commit 4974daf

Browse files
Add support for http method PATCH
1 parent 93aec0b commit 4974daf

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)