From c57f950e964c5535fd36dca059a2c5ff33e76d9e Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Mon, 30 Jan 2023 16:56:27 -0800 Subject: [PATCH] Fix domain matching in readme examples Update the suggested regex patterns for subdomains: - subdomains only: Checking for `^.*` before a period is unnecessary. - domain and subdomains: the suggested pattern should have only matched example.com and *.example.com, but it actually allowed myexample.com. Fix the pattern. --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 3b76c95..e77c340 100644 --- a/readme.md +++ b/readme.md @@ -118,8 +118,8 @@ APP__HOSTS_WHITELIST_REGEX="^(example\\.com|mysecondwebsite\\.com)$" # A JavaScript regular expression that the host must match. By default, it matches ANY HOST, MAKING # YOUR PROXY AVAILABLE TO ANYONE. Make sure you screen all special regexp characters here. Examples: # APP__HOSTS_WHITELIST_REGEX="^example\\.com$" (only the domain example.com is allowed to access the proxy) -# APP__HOSTS_WHITELIST_REGEX="^.*\\.example\\.com$" (only subdomains of example.com are allowed) -# APP__HOSTS_WHITELIST_REGEX="^.*\\.?example\\.com$" (example.com and all its subdomains are allowed) +# APP__HOSTS_WHITELIST_REGEX="\\.example\\.com$" (only subdomains of example.com are allowed) +# APP__HOSTS_WHITELIST_REGEX="(^|\\.)example\\.com$" (example.com and all its subdomains are allowed) # APP__HOSTS_WHITELIST_REGEX="^(example\\.com|mysecondwebsite\\.com)$" (multiple specified domains are allowed) ```