-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix escaping query parameters #369
Conversation
…n the query parameters
|
@mattt OK, then you need to change the characters to escape because the current implementation escapes "/" and it should NOT |
@slizeray This is incorrect. According to RFC 3986 § 2.2, |
@mattt This is perfectly correct. According to the RFC 3986 $ 3.4 The characters slash ("/") and question mark ("?") may represent data within the query component. Indeed, Apple has perfectly implemented the RFC. |
@slizeray That doesn't exactly inspire confidence. If it comes down to a question of usability concerns versus incorrect server-side handling, I'll err on the side of safety. |
@mattt Well you put back some older code because of memory consumption. In between you had exactly the behaviour that now you think is wrong? |
@slizeray I wasn't aware of this specific difference in behavior previously, but knowing this now, I'm more comfortable keeping consistent default encoding behavior between Alamofire and AFNetworking. I understand how this might be inconvenient, which is why Alamofire offers two different ways to easily override this. First, you could use the |
@mattt OK Thanks I will give it try! As long as there is a solution, I am fine with that! That said, we could have an option both for Alamofire and AFNetworking.... |
For escaping the query parameters I propose to use the iOS 7 API and above
stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())
The result is not the same as the current implementation which for instances escapes the / parameter whereas iOS does NOT