Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

URL encoding was wrong, stringByAddingPercentEscapeUsingEncoding just…

… doesn't do the job.
  • Loading branch information...
commit 0d982e47c1bfdc62efb93854b1a1ffd2f3a78983 1 parent e3fd3f7
Deepak Prabhakara authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 OAuthConsumeriPhoneLib/OAuthConsumerSrc/OARequestParameter.m
View
10 OAuthConsumeriPhoneLib/OAuthConsumerSrc/OARequestParameter.m
@@ -52,14 +52,20 @@ - (void)dealloc
[super dealloc];
}
+-(NSString *)urlEncode:(NSString*)stringThatNeedsEncoding
+{
+ NSString *result = (NSString*)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)stringThatNeedsEncoding, NULL, CFSTR(";/?:@&=$+{}<>, "), kCFStringEncodingUTF8);
+ return [result autorelease];
+}
+
- (NSString *)URLEncodedName
{
- return [self.name stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
+ return [self urlEncode:self.name]; //[self.name stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
}
- (NSString *)URLEncodedValue
{
- return [self.value stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
+ return [self urlEncode:self.value]; //[self.value stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
}
- (NSString *)URLEncodedNameValuePair
Please sign in to comment.
Something went wrong with that request. Please try again.