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

Path matching fails on paths with capitals #177

Open
mikedlr opened this issue Oct 9, 2022 · 5 comments
Open

Path matching fails on paths with capitals #177

mikedlr opened this issue Oct 9, 2022 · 5 comments

Comments

@mikedlr
Copy link

mikedlr commented Oct 9, 2022

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

@mikedlr mikedlr changed the title Path matching fails on paths with caiptals Path matching fails on paths with capitals Oct 9, 2022
@Cybolic
Copy link

Cybolic commented Nov 15, 2022

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:

  1. Keep lower-casing the user input, but make the regexes case insensitive by default (/i).
  2. 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.

@iainelder
Copy link

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.

@iainelder
Copy link

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 /.

@iainelder
Copy link

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.

@ipwnponies
Copy link

This is a duplicate issue, I posted a workaround #120 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants