Skip to content
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

"+" in Query parameters #87

Closed
gvklooster opened this issue Mar 1, 2017 · 2 comments
Closed

"+" in Query parameters #87

gvklooster opened this issue Mar 1, 2017 · 2 comments

Comments

@gvklooster
Copy link

gvklooster commented Mar 1, 2017

I have a deeplink where the URL uses the "+" symbol to indicate spaces. Not only in the path, but also in the query part.

For example:
...myBaseURL/invitations/hXVzNLTySmb4TGDL2yxR/accept?invitation_email=daan%40example.com&list_name=Test2+%F0%9F%98%82+%2BHans&actor_name=Daan+De+Boer

Now the NSDictionary *parameters in the handler still contain those "+" symbols instead of being replaced with spaces. So I added this code in my application:continueUserActivity:restorationHandler: method:

NSString *changedURL = [[userActivity.webpageURL absoluteString] stringByReplacingOccurrencesOfString:@"+" withString:@"%20"]; NSURL *outputURL = [NSURL URLWithString:changedURL]; return [JLRoutes routeURL:outputURL];

In my opinion JLRoutes should take care of this, or am I missing something?

@joeldev
Copy link
Owner

joeldev commented Mar 23, 2017

JLRoutes has a global option already for this, but it was not being properly applied to query params:

/// Tells JLRoutes that it should manually replace '+' in parsed values to ' '. Defaults to YES.
+ (void)setShouldDecodePlusSymbols:(BOOL)shouldDecode;

Good find!

@joeldev
Copy link
Owner

joeldev commented Mar 23, 2017

This fix is now available in JLRoutes 2.0.2 (just pushed to CocoaPods).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants