is_same_domain
Return True if the host is either an exact match or a match
to the wildcard pattern.
Any pattern beginning with a period matches a domain and all of its
subdomains. (e.g. .example.com matches example.com and
foo.example.com). Anything else is an exact string match.
def is_same_domain(
host: string,
pattern: string
) - > boolean
Return True if the host is either an exact match or a match to the wildcard pattern. Any pattern beginning with a period matches a domain and all of its subdomains. (e.g. .example.com matches example.com and foo.example.com). Anything else is an exact string match.
Parameters
| Name | Type | Description |
|---|---|---|
| host | string | The hostname string to be validated against the pattern |
| pattern | string | The domain name or wildcard pattern (starting with a dot) to match against |
Returns
| Type | Description |
|---|---|
boolean | True if the host matches the domain or subdomain pattern, False otherwise |