Skip to main content
Module

x/keywork/mod.ts>HTTP.CORSOptions

A library for building V8 Isolate web apps on Cloudflare Workers, Deno, and Node.JS
Go to Latest
interface HTTP.CORSOptions
import { type HTTP } from "https://deno.land/x/keywork@v6.0.1/mod.ts";
const { CORSOptions } = HTTP;

Properties

allowedOrigins: AllowedOrigins
allowedMethods: HTTPMethod[]
optional
allowedHeaders: string[]

Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.

Defaults to reflecting the headers specified in the incoming request's Access-Control-Request-Headers header.

cachePreflightDuration: number

If provided, preflight responses can be cached for subsequent requests made to the same URL using the Access-Control-Max-Age header. The value is in seconds.

includeCredentials: boolean

If true, allows credentials to be sent with the request. Credentials are cookies, authorization headers, or TLS client certificates.

exposeHeaders: string[]

Indicates which headers can be exposed as part of the response by listing their names.