Permalink
Browse files

Exclude oauth_ prefix parameters from request in request helper

  • Loading branch information...
1 parent a67b05f commit 60ee0052619cca9631d4e876435441a64fe6648c @jnormore jnormore committed Apr 23, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 AFOAuth1Client/AFOAuth1Client.m
@@ -351,7 +351,15 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method
path:(NSString *)path
parameters:(NSDictionary *)parameters
{
- NSMutableURLRequest *request = [super requestWithMethod:method path:path parameters:nil];
+ NSMutableDictionary *requestParameters = [parameters mutableCopy];
+ for (NSString* parameterName in parameters) {
+ if ([parameterName hasPrefix:@"oauth_"]) {
+ [requestParameters removeObjectForKey:parameterName];
+ }
+ }
+
+ NSMutableURLRequest *request = [super requestWithMethod:method path:path parameters:requestParameters];
+
[request setValue:[self authorizationHeaderForMethod:method path:path parameters:parameters] forHTTPHeaderField:@"Authorization"];
[request setHTTPShouldHandleCookies:NO];

0 comments on commit 60ee005

Please sign in to comment.