Skip to content

basalt / drives/src / hostAllowed

Function: hostAllowed() ​

> hostAllowed(host, allowed): boolean

Defined in: drives/src/fetch.ts:184

Host allowlist check.

A bare entry matches that host exactly. A leading dot matches subdomains only — .googleusercontent.com allows abc.googleusercontent.com but not googleusercontent.com itself, and critically not evilgoogleusercontent.com, which a naive endsWith would wave through.

Parameters ​

host ​

string

allowed ​

readonly string[]

Returns ​

boolean

Released under the MIT License.