-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Describe the Bug
The current implementation if the non-proxy-host matching in the HTTP client support currently treats the whole host as regex pattern, leading to . matching any character instead of only a dot. According to our docs, only * are allowed as wildcards at the beginning and the end of a host (host patterns delimited by |:
Specify as a list of patterns, separated by |.
Patterns can start or end with a * for wildcards.
Steps to Reproduce
Background to find this was this Copilot comment:
toRegexcurrently only replaces*with.*and leaves other regex metacharacters (notably.) unescaped. This means patterns likeexample.dewill match unintended hosts (e.g.exampleXde) because.is treated as “any char”, which differs from the documentedhttp.nonProxyHostssemantics where.is literal. Consider escaping regex metacharacters (e.g., viaPattern.quoteper token) while still supporting*wildcards and|separators, and extend the tests to cover these edge cases.
Expected Behavior
Regex patterns within a host pattern are treated as normal chars as documented. example.de does not match exampleXde.
Environment
- Library version: 8.9.0
Metadata
Metadata
Assignees
Type
Projects
Status