nitro icon indicating copy to clipboard operation
nitro copied to clipboard

`routeRules` are case sensitive

Open pi0 opened this issue 1 year ago • 2 comments

extracted from https://github.com/unjs/nitro/issues/2146

Likewise, routeRules are case sensitive. In your example, requesting /Support-Me will not redirect either. However, URIs should be case insensitive.

Let me know if this needs a separate issue. I figure it's so closely related it might make sense to tackle them together. Vue-Router addresses them together in the documentation.

Originally posted by @lwpinion in https://github.com/unjs/nitro/issues/2146#issuecomment-1949087429 /cc @lpinion-ew

pi0 avatar Mar 08 '24 17:03 pi0

According to both RFC 3986 / WHATWG standards, URL path is case sensitive by default, which means /path and /Path are different.

We can introduce a new sensitive: false route rule meta but it also means we need to add extra runtime overhead for checking incoming URL against route rules twice + we diverge from Web standards.

pi0 avatar Mar 08 '24 17:03 pi0

According to both RFC 3986 / Whatwg standards, URL path is case sensitive by default, which means /path and /Path are different.

This issue may not be entirely related, but this definitely seems to be an ongoing and divisive conversation across the ecosystem: https://github.com/vuejs/vue-router/issues/1214

That being said, I can definitely understand any hesitancy since this would add runtime overhead.

lwpinion avatar Mar 08 '24 18:03 lwpinion