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

BUG: errors handling unicode emoji #499

Open
veesahni opened this issue May 26, 2021 · 0 comments · May be fixed by troch/path-parser#67
Open

BUG: errors handling unicode emoji #499

veesahni opened this issue May 26, 2021 · 0 comments · May be fixed by troch/path-parser#67

Comments

@veesahni
Copy link

Router5 Version: 8.0.1
Node Version: 12.16.3

Code to reproduce bug:

      const router = createRouter({ name: 'users', path: '/users?:q' })
      console.log(router.matchPath('/users?q=test漢字'))
      // outputs: {name: "users", params: {…}, path: "/users?q=test%E6%BC%A2%E5%AD%97", meta: {…}}
      console.log(router.matchPath('/users?q=60ad50🚀'))
      // outputs: {name: "users", params: {…}, path: "/users?q=60ad50%F0%9F%9A%80", meta: {…}}
      router.setRootPath('/base')
      console.log(router.matchPath('/base/users?q=test漢字'))
      // outputs: {name: "users", params: {…}, path: "/base/users?q=test%E6%BC%A2%E5%AD%97", meta: {…}}
      console.log(router.matchPath('/base/users?q=60ad50🚀'))
      // EXCEPTION: Uncaught URIError: URI malformed

Discussion:

  • Router 5 does not handle unicode emoji in path or query parameters.. but only when root path is not set
  • I chased the bug down to the underlying library and raised a bug there
  • Has anybody else encountered this?
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

Successfully merging a pull request may close this issue.

1 participant