Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

URL encoding is wrong #86

Merged
merged 4 commits into from

2 participants

@deepakprabhakara

URL encoding was wrong, stringByAddingPercentEscapeUsingEncoding just doesn't do the job.

@bengottlieb bengottlieb merged commit 89404fa into bengottlieb:master
@bengottlieb
Owner

thanks, merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 14, 2011
  1. URL encoding was wrong, stringByAddingPercentEscapeUsingEncoding just…

    Deepak Prabhakara authored
    … doesn't do the job.
  2. Updated library file (all 3 arch's)

    Deepak Prabhakara authored
  3. Support more reserved characters while encoding.

    Deepak Prabhakara authored
  4. Updated library (release version)

    Deepak Prabhakara authored
This page is out of date. Refresh to see the latest.
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
View
BIN  Twitter+OAuth/Libraries & Headers/libOAuth.a
Binary file not shown
Something went wrong with that request. Please try again.