mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
Use url.hostname instead of url.host to allow host from environment variable (#326)
Co-authored-by <yohan.boniface@free.fr>
This commit is contained in:
@@ -117,7 +117,7 @@ export function matchesBaseDomain(domain: string, baseDomain: string) {
|
||||
}
|
||||
|
||||
export function isEnvironmentAllowedHost(url: string|URL) {
|
||||
const urlHost = (typeof url === 'string') ? url : url.host;
|
||||
const urlHost = (typeof url === 'string') ? url : url.hostname;
|
||||
return (process.env.GRIST_ALLOWED_HOSTS || "").split(",").some(domain =>
|
||||
domain && matchesBaseDomain(urlHost, domain)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user