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

Alias routing case sensitivity #2087

Open
Memoryfox opened this issue Jul 25, 2024 · 1 comment
Open

Alias routing case sensitivity #2087

Memoryfox opened this issue Jul 25, 2024 · 1 comment
Assignees

Comments

@Memoryfox
Copy link

Hello,

we have migrated some older ASPX sites to Piranha and have defined a lot of aliases. After a few weeks running we detected many 404 errors, although aliases were defined for the requested URLs. The reason for this is the different case sensitivity of the requested URLs.

With cache turned on, the alias lookup is always case sensitive (direct comparison). Without cache it depends on the database (i. e. collation on SQLServer).

Example:
Alias: /public/support.aspx -> /support
Request 1: /public/support.aspx -> redirected
Request 2: /public/Support.aspx -> 404 Not Found

The different case sensitivity of old URLs is due to historical reasons. It is also possible for users to enter a URL manually in the browser and save it as a favorite. The case sensitivity is then undefined.

What do you think? Thank you.

@tidyui
Copy link
Member

tidyui commented Jul 25, 2024

I would consider this a bug in the cache lookup, will add this to the next release. As a temporary fix

  1. Make sure all aliases in the database are lower-case
  2. Add a custom middle first in the pipeline that rewrites the incoming url to lowercase and then just passes it on.

@tidyui tidyui moved this to Todo in Version 12.0 Jul 25, 2024
@tidyui tidyui self-assigned this Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

2 participants