Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/keywork/http/functions/cors.ts>CORSOptions

A library for building V8 Isolate web apps on Cloudflare Workers, Deno, and Node.JS
Latest
interface CORSOptions
import { type CORSOptions } from "https://deno.land/x/keywork@v6.2.1/http/functions/cors.ts";

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.