class CORSMiddleware
extends Middleware
import { CORSMiddleware } from "https://deno.land/x/drash@v3.0.0-beta.2/src/modules/middleware/CORS/mod.ts";
Constructors
new
CORSMiddleware(options?: Options)Construct the middleware that handles CORS requests.
Methods
protected
appendHeaderValue(header: { key: string; value: string; }, headers: Headers): voidprotected
getAllowOriginHeaderValue(request: Request): string | nullprotected
getCorsResponseHeaders(request: Request): HeadersAll CORS-related response headers start out with the values defined in this method.
protected
setHeaderAllowCredentials(headers: Headers): voidprotected
setHeaderAllowHeaders(req: Request, headers: Headers): voidprotected
setHeaderAllowMethods(headers: Headers)protected
setHeaderAllowOrigin(request: Request, headers: Headers): voidprotected
setHeaderExposeHeaders(headers: Headers): voidprotected
setHeaderMaxAge(headers: Headers)protected
setPreflightHeaders(request: Request, headers: Headers): void