Host

@Serializable
class Host(val name: String, val schemes: List<String> = listOf("http", "https"), val subdomains: List<String> = emptyList())(source)

A collection of host values that can be used to configure CORS.

See also: https://ktor.io/docs/cors.html#hosts

Parameters

name

The hostname (and optional port), e.g. "somesite.com:1234". Do not put the scheme in the hostname, like "http://badexample.com". That should be mentioned separately. "*" is a special value which would mean allow any host to send a request to this site, but this should be avoided in production.

schemes

Support HTTP schemes for this cross-site request, e.g. "http"

subdomains

Subdomains for the site, e.g. "media" if you wanted to allow "media.varabyte.com"

Constructors

Link copied to clipboard
constructor(name: String, schemes: List<String> = listOf("http", "https"), subdomains: List<String> = emptyList())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard