You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have discussed this feature request with the community.
Describe the background of your feature request
As of today, <*> will match all characters except / and ., those being separators in paths and hosts respectively.
It always matching both makes it quite useless when used in paths, as it will capture path segments containing dots in an unexpected way.
Describe your idea
Ideally, I would be able to use <*> in hosts to mean "everything except ." and <*> in paths to indicate "everything except /".
First off, the excluded characters should be configurable in a manner as described by @dadrushere:
In principle, there are 4 places for the corresponding configuration:
The default (as present today)
Globally in heimdall' config. This configuration would apply to all rules
On a rule set level. This configuration would apply to all rules in a rule set
In a particular rule as part of the matcher definition.
The more specific one would take precedence.
While supporting all options would give more freedom, I personally don't know, whether all of them are needed at all. Maybe 3 and 4 are fully sufficient. Maybe event just 4 (in addition to 1)
This would allow for at least handling cases where globs are only used in one part of the URL effectively, e.g. to only exclude slashes if the globs are always in paths.
Optimally however, I believe that Heimdall could split up <rule>.match.url into <rule>.match.host and <rule>.match.path. This is closer to the way <rule>.forward_to works today and IMO would also prevent a certain class of errors (I cannot think of a usecase where a glob spanning both the host and the path is a good idea).
The excluded characters could then be configured individually for host and path, with defaults of . and / respectively, meaning the vast majority of users would never need to even touch the defaults to get expected behavior.
Are there any workarounds or alternatives?
The current alternative is using regex matchers instead, which is more error-prone due to the regex being more difficult to read (e.g. [^\/]* for only excluding slashes).
Preflight checklist
Describe the background of your feature request
As of today,
<*>
will match all characters except/
and.
, those being separators in paths and hosts respectively.It always matching both makes it quite useless when used in paths, as it will capture path segments containing dots in an unexpected way.
Describe your idea
Ideally, I would be able to use
<*>
in hosts to mean "everything except.
" and<*>
in paths to indicate "everything except/
".First off, the excluded characters should be configurable in a manner as described by @dadrus here:
This would allow for at least handling cases where globs are only used in one part of the URL effectively, e.g. to only exclude slashes if the globs are always in paths.
Optimally however, I believe that Heimdall could split up
<rule>.match.url
into<rule>.match.host
and<rule>.match.path
. This is closer to the way<rule>.forward_to
works today and IMO would also prevent a certain class of errors (I cannot think of a usecase where a glob spanning both the host and the path is a good idea).The excluded characters could then be configured individually for
host
andpath
, with defaults of.
and/
respectively, meaning the vast majority of users would never need to even touch the defaults to get expected behavior.Are there any workarounds or alternatives?
The current alternative is using regex matchers instead, which is more error-prone due to the regex being more difficult to read (e.g.
[^\/]*
for only excluding slashes).Version
dev
Additional Context
This feature request has a corresponding Discord idea thread here: https://discord.com/channels/1100447190796742698/1121782759191490622/1121782759191490622
The text was updated successfully, but these errors were encountered: