Closed jeffreythomasprice closed 7 months ago
That is definitely an issue that slipped through. #3353 has a backwards compatible fix that allows case insensitive route lookups by setting
app.routes.caseSensitive = false
Appreciate it! I'll look out for the next release.
Steps to reproduce
/hello
/HELLO
Expected behavior
Any capitalization of the path should hit the same feathers service.
It appears that paths were matched in a case-insensitive manner prior to feathers 5.
Actual behavior
Exact capitalization is required. It does not appear to be configurable.
System configuration
packages/transport-commons/src/routing/router.ts
, which is on 5.0.8.Code Sample
We're using express, and we tried playing with express properties to control case-sensitivity, e.g.
We played with several variants of constructing an express app and configuring it's path matching, then associating it with a feathers app. After we found
packages/transport-commons/src/routing/router.ts
it became clear that the path matching isn't using express' built-in behavior at all.We found some text in this document https://feathersjs.com/guides/whats-new.html that references new path matching behavior, but no mention of case sensitivity. That links to https://feathersjs.com/api/application.html#lookup-path, but ditto.
We've worked around this by changing the path matching behavior in
packages/transport-commons/src/routing/router.ts
. Our snippet is slightly more complicated, but the relevant change is: