containerise
containerise copied to clipboard
Path matching fails on paths with capitals
Regexps containing capitals are converted to lower case but then fail to match paths which contain capitals.
What I did
@?.*.example.com/UpperCase go to www.example.com/UpperCase
What happens
When I enter the string above it gets converted to lower case
@?.*.example.com/UpperCase
and then the match fails.
What I expected to happen
the regexp should maintain case (possibly excluding the domain name? not sure how to handle this) the site with an upper case character in the path sshould be possible to match
Can confirm this. My workaround for now is to write them as @?.*.example.com/.pper.ase
, which is obviously not ideal.
I'd recommend picking one of these solutions:
- Keep lower-casing the user input, but make the regexes case insensitive by default (
/i
). - Don't touch the case of the user input.
Option one is more in line with the current behaviour and probably makes the most sense as most web servers don't care about case anyway.
Don't touch the case of the user input
I'd prefer this option. Just trust that I know what I'm doing with my input. If the regex ends up being invalid or slow, then fail gracefully, but don't force all the uppercase I just typed in to be lowercase. That's annoying.
make the regexes case insensitive by default
@Cybolic , do you know how to set a single regex to be case sensitive? Containerise seems to have a proprietary syntax for defining one.
I think a JavaScript regex would have an i
after the closing /
, but Containerise's regexes are not surrounded by /
.
My use case is a URL for a Slack workspace such as https://app.slack.com/client/A11A11A1AAA/A11AA1AAAA
.
If I need to replace every capital letter with a .
to work around the case sensitivity, then all I can match on are the numbers. It might just work, but it feels quite shoddy.
This is a duplicate issue, I posted a workaround https://github.com/kintesh/containerise/issues/120#issuecomment-2116002236