Returns TRUE if every input URL is either:
a syntactically valid HTTPS URL, and (if set) whose host matches allowed_hosts, or
an HTTP URL whose host matches allowed_non_https_hosts (e.g. localhost, 127.0.0.1, ::1),
and (if set) also matches allowed_hosts.
If the input omits the scheme (e.g., "localhost:8080/cb"), this function
will first attempt to validate it as HTTP (useful for loopback development),
and if that fails, as HTTPS. This mirrors how helpers normalize inputs for
convenience while still enforcing the same host and scheme policies.
allowed_hosts is thus an allowlist of hosts/domains that are permitted, while
allowed_non_https_hosts defines which hosts are allowed to use HTTP instead of HTTPS.
If allowed_hosts is NULL or length 0, all hosts are allowed (subject to scheme rules),
but HTTPS is still required unless the host is in allowed_non_https_hosts.
Since allowed_hosts supports globs, a value like "*" matches any host
and therefore effectively disables endpoint host restrictions. Only use a catch‑all
pattern when you truly intend to allow any host. In most deployments you should pin
to your expected domain(s), e.g. c(".example.com") or a specific host name.
Wildcards: allowed_hosts and allowed_non_https_hosts support globs:
* = any chars, ? = one char. A leading .example.com matches the
domain itself and any subdomain.
Any non-URLs, NAs, or empty strings cause a FALSE result.