mirror of
https://github.com/traefik/traefik.git
synced 2025-05-05 15:33:01 +00:00
Allow underscore character in hostSNI matcher
This commit is contained in:
parent
2087e11f55
commit
ddb32ef86f
@ -310,7 +310,7 @@ func alpn(tree *matchersTree, protos ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var hostOrIP = regexp.MustCompile(`^[[:alnum:]\.\-\:]+$`)
|
||||
var hostOrIP = regexp.MustCompile(`^[[:word:]\.\-\:]+$`)
|
||||
|
||||
// hostSNI checks if the SNI Host of the connection match the matcher host.
|
||||
func hostSNI(tree *matchersTree, hosts ...string) error {
|
||||
|
@ -743,6 +743,11 @@ func Test_HostSNI(t *testing.T) {
|
||||
ruleHosts: []string{"foo.bar"},
|
||||
serverName: "foo.bar",
|
||||
},
|
||||
{
|
||||
desc: "Matching hosts with subdomains with _",
|
||||
ruleHosts: []string{"foo_bar.example.com"},
|
||||
serverName: "foo_bar.example.com",
|
||||
},
|
||||
{
|
||||
desc: "Matching IPv4",
|
||||
ruleHosts: []string{"127.0.0.1"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user