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

Email with a plus is not decoded #187

Closed
lc3t35 opened this issue Dec 11, 2019 · 4 comments
Closed

Email with a plus is not decoded #187

lc3t35 opened this issue Dec 11, 2019 · 4 comments

Comments

@lc3t35
Copy link

lc3t35 commented Dec 11, 2019

I'm using Expo Linking.parse which relies on url-parse, and my url includes an email with this allowed form "[email protected]".
Decoding is incorrect as show by this additional test in PR #186

@lpinca
Copy link
Member

lpinca commented Dec 12, 2019

The third argument of the constructor accept a custom function which can be used to parse the query string. See https://github.com/unshiftio/url-parse#usage

By default https://github.com/unshiftio/querystringify is used which is limited by design.

@lc3t35 lc3t35 changed the title Email with a plus are not decoded Email with a plus is not decoded Dec 14, 2019
@lc3t35
Copy link
Author

lc3t35 commented Dec 14, 2019

Thank you @lpinca , I've opened an issue for expo here expo/expo#6528, so we can see how to fix this.
Can you dig a little why querystringify replaces a + (plus sign) by space in a param ?

function decode(input) {
  try {
    return decodeURIComponent(input.replace(/\+/g, ' '));
  } catch (e) {
    return null;
  }
}

@lpinca
Copy link
Member

lpinca commented Dec 14, 2019

See unshiftio/querystringify#7

@lpinca
Copy link
Member

lpinca commented Aug 24, 2021

I'm closing this as answered.

@lpinca lpinca closed this as completed Aug 24, 2021
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