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'd propose to make hostname a RegExp.
First, to match things like: .forHostname(/^.+?\.domain.com/)
Second, to keep up with the URL matchers (.forGet(), .forPost() etc) which can take RegExp.
I.e.
forHostname(hostname: string): this;
gets:
forHostname(hostname: string |RegExp): this;
The text was updated successfully, but these errors were encountered:
👍 Sounds good to me, PRs welcome. The one tricky bit is serialization for remote clients, since JSON can't represent regexes natively.
You can see how RegexPathMatcher handles it here - it stores the regex as a string, which only gets converted into a regex inside matches(req).
I think I'd suggest creating this as a new matcher like RegexHostnameMatcher, with the forHostname method choosing between the two implementations. That's the same way that path matching works to do strings + regexes, and that way you don't have to differentiate between the raw-string and regex-serialized--as-string data when deserializing rules from remote clients.
I'd propose to make hostname a RegExp.
First, to match things like:
.forHostname(/^.+?\.domain.com/)
Second, to keep up with the URL matchers (
.forGet()
,.forPost()
etc) which can takeRegExp
.I.e.
gets:
The text was updated successfully, but these errors were encountered: