Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Trim whitespace and new line characters #12

Merged
merged 1 commit into from

2 participants

@romaonthego

Issue with Tumblr OAuth: it sends token response with "\n" in front like this:

"
oauth_token=XXX&oauth_token_secret=YYY"

So, code fails on this line: if ([key isEqualToString:@"oauth_token"]) {

@rsieiro rsieiro merged commit e4db8d1 into from
@rsieiro
Owner

Merged it. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  RSOAuthEngine/RSOAuthEngine.m
View
2  RSOAuthEngine/RSOAuthEngine.m
@@ -301,7 +301,7 @@ - (void)fillTokenWithResponseBody:(NSString *)body type:(RSOAuthTokenType)tokenT
for (NSString *pair in pairs)
{
NSArray *elements = [pair componentsSeparatedByString:@"="];
- NSString *key = [elements objectAtIndex:0];
+ NSString *key = [[elements objectAtIndex:0] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *value = [[elements objectAtIndex:1] urlDecodedString];
if ([key isEqualToString:@"oauth_token"]) {
Something went wrong with that request. Please try again.