Permalink
Browse files

Replacing & with %26 if content type header is set to form encoded

  • Loading branch information...
1 parent 2000aae commit 41e28e7c962c3ca31aa26717029954800d10d828 @mmattozzi committed Jul 29, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 request/CRCFormEncodedRequest.m
@@ -28,9 +28,11 @@ +(void)createRequest:(NSMutableURLRequest *)request
if([body length] > 0)
[body appendData:[@"&" dataUsingEncoding:NSUTF8StringEncoding]];
+ value = [value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+ value = [value stringByReplacingOccurrencesOfString:@"&" withString:@"%26"];
[body appendData:[[NSString stringWithFormat:@"%@=%@",
[key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
- [value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]
+ value]
dataUsingEncoding:NSUTF8StringEncoding]];
}
}

0 comments on commit 41e28e7

Please sign in to comment.