This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue #243] Fixing AFQueryStringFromParametersWithEncoding to encode…
… nested array values correctly
- Loading branch information
Showing
1 changed file
with
82 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
acd6e49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
I didn't agree with this commit:
Line 166
return [[[AFQueryStringComponent alloc] initWithKey:AFURLEncodedStringFromStringWithEncoding([key description], stringEncoding) value:AFURLEncodedStringFromStringWithEncoding([value description], stringEncoding)] autorelease];
Must be
return [[[AFQueryStringComponent alloc] initWithKey:[key description] value:AFURLEncodedStringFromStringWithEncoding([value description], stringEncoding)] autorelease];
AFURLEncodedStringFromStringWithEncoding encode the '[' and ']' chars to '%5B' and '%5D' in the keys.
acd6e49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't necessarily disagree, but aren't the [ and ] characters equivalent to their percent-encoded representations on the server?
acd6e49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a RoR server hosted by heroku, with a multipart request, a string-encoded Key doesn't work.
It's seems there's differences between multipart request and URL-encoded request.
I'll do some tests and come back.