@@ -266,9 +266,9 @@ public function doAction()
266
266
if (substr ($ host , 0 , 2 ) == "*. " ) {
267
267
// hdr(host) -m reg -i ^[^\.]+\.example\.org$
268
268
// hdr(host) -m reg -i ^[^\.]+\.example\.org(:[0-9]+)?$
269
- $ hostACL = "hdr(host) -m reg -i ^[^\.]+ " .str_replace (". " , "\. " , substr ($ host , 1 ))."(:[0-9]+)?$ " ;
269
+ $ hostACL = "hdr(host) -m reg -i ^[^\.]+ " .str_replace ([ ". " , "- " ], [ " \. ", " \- " ] , substr ($ host , 1 ))."(:[0-9]+)?$ " ;
270
270
} else {
271
- $ hostACL = "hdr(host) -m reg -i ^ " .str_replace (". " , "\. " , $ host )."(:[0-9]+)?$ " ;
271
+ $ hostACL = "hdr(host) -m reg -i ^ " .str_replace ([ ". " , "- " ], [ " \. ", " \- " ] , $ host )."(:[0-9]+)?$ " ;
272
272
}
273
273
274
274
// https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types
@@ -319,7 +319,7 @@ public function doAction()
319
319
// hdr(host) -m reg -i ^[^\.]+\.example\.org$
320
320
// hdr(host) -m reg -i ^[^\.]+\.example\.org(:[0-9]+)?$
321
321
// sni should never have the port on the end as the host header may have
322
- $ hostACL = "req_ssl_sni -m reg -i ^[^\.]+ " .str_replace (". " , "\. " , substr ($ host , 1 ));
322
+ $ hostACL = "req_ssl_sni -m reg -i ^[^\.]+ " .str_replace ([ ". " , "- " ], [ " \. ", " \- " ] , substr ($ host , 1 ));
323
323
} else {
324
324
$ hostACL = "req_ssl_sni -m str -i $ {host}" ; // exact match case-insensitive
325
325
}
0 commit comments