Skip to content

Commit

Permalink
docs(cors): add comments to origin option
Browse files Browse the repository at this point in the history
  • Loading branch information
aaharu committed Oct 4, 2024
1 parent db0bb01 commit 9cdc4d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/types/utils/cors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import type { HTTPMethod } from "..";

export interface H3CorsOptions {
/**
* This determines the value of the "access-control-allow-origin" response header.
* The wildcard characters "*" can be used to allow all origins.
* An array of strings or regular expressions can be used with origin matching.
* And a custom function to validate the origin. It takes the origin as an argument and returns `true` if allowed.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
*/
origin?: "*" | "null" | (string | RegExp)[] | ((origin: string) => boolean);
methods?: "*" | HTTPMethod[];
allowHeaders?: "*" | string[];
Expand Down

0 comments on commit 9cdc4d1

Please sign in to comment.