Is there a global setting which allows the Path matchers to work in a case insensitive way?
I’ve a very specific case where I want to do
pathPrefix("string")
and want it to be matched without being case sensitive. I do know we could have pathPrefix(Segment) => (segment) then convert segment toLower and match, but the above case the string has to specifically match in a case insensitive way, is there a way to do this?
Akka HTTP tries to adhere to the standards, and according to them, URL paths are case sensitive. There isn’t any configuration parameter where this can be toggled or changed.
Of course, you can always write your own path directive that checks prefixes in a case insensitive way. One way to do so is to map the request’s path to be lowercase and then convert the path prefixes strings also to lowercase. This should do the trick.