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] URL paths containing non ASCII characters returns 404 #546

Open
DoLoop216 opened this issue May 22, 2024 · 0 comments
Open

[BUG] URL paths containing non ASCII characters returns 404 #546

DoLoop216 opened this issue May 22, 2024 · 0 comments

Comments

@DoLoop216
Copy link

Steps to reproduce:

  • Create category with url key = čačak
  • Try accessing given category (localhost:3000/čačak)

=======
Why bug happens:
When you update category with url key, it's value is saved to url_rewrite and when middleware try finding url rewrite it compare it against request.originalUrl.

Problem is that before making request, url is encoded since only ASCII characters are valid URL characters, so čačak becomes %C4%8Da%C4%8Dak%0A before sent to the server.

Once received by server, we try finding url_rewrite rule (which in database is written as čačak and since čačak !== %C4%8Da%C4%8Dak%0A, rule is not found and 404 is returned.

To resolve this, before comparing to the record in database, url should be decoded from ASCII to UTF-8.

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

1 participant