allowHost

fun allowHost(host: String, schemes: List<String> = listOf("http", "https"), subDomains: List<String> = emptyList())

Allows requests from the specified domains and schemes. A wildcard is supported for either the host or any subdomain. If you specify a wildcard in the host, you cannot add specific subdomains. Otherwise, you can mix wildcard and non-wildcard subdomains as long as the wildcard is always in front of the domain, e.g. *.sub.domain.com but not sub.*.domain.com.

Parameters

host

host as it appears in the Host header (e.g. localhost:8080)

schemes

protocols allowed for the origin site; defaults to http and https

subDomains

additional subdomains for the given host