0.0.49 • Published 7 months ago
@hattip/cors v0.0.49
@hattip/cors
Cross-Origin Resource Sharing(CORS) middleware for Hattip.
Options
export interface CorsOptions {
/** `Access-Control-Allow-Origin`, default is request Origin header */
origin?:
| string
| ((ctx: RequestContext) => string | false | Promise<string | false>);
/** `Access-Control-Allow-Methods`, default is 'GET,HEAD,PUT,POST,DELETE,PATCH' */
allowMethods?: string | string[] | null;
/** `Access-Control-Expose-Headers` */
exposeHeaders?: string | string[];
/** `Access-Control-Allow-Headers` */
allowHeaders?: string | string[];
/** `Access-Control-Max-Age` in seconds */
maxAge?: string | number;
/** `Access-Control-Allow-Credentials` */
credentials?: boolean | ((ctx: RequestContext) => boolean | Promise<boolean>);
/**
* `Cross-Origin-Opener-Policy` & `Cross-Origin-Embedder-Policy` headers.',
* default is false
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/Planned_changes
*/
secureContext?: boolean;
/**
* Handle `Access-Control-Request-Private-Network` request by return `Access-Control-Allow-Private-Network`, default to false
* @see https://wicg.github.io/private-network-access/
*/
privateNetworkAccess?: boolean;
}
License
- This is a port of koajs/cors by koajs and contributors under the MIT License. They are not affiliated with Hattip.
- Hattip port by Fatih Aygün under the MIT License.
0.0.49
7 months ago
0.0.46
12 months ago
0.0.47
10 months ago
0.0.48
9 months ago
0.0.45
1 year ago
0.0.44
1 year ago
0.0.43
1 year ago
0.0.42
1 year ago
0.0.41
1 year ago
0.0.40
1 year ago
0.0.39
1 year ago
0.0.38
1 year ago
0.0.37
1 year ago
0.0.36
1 year ago
0.0.35-canary.2
2 years ago
0.0.35-canary.7
2 years ago
0.0.35-canary
2 years ago
0.0.35
2 years ago
0.0.34
2 years ago
0.0.33
2 years ago
0.0.30
2 years ago
0.0.31
2 years ago
0.0.32
2 years ago
0.0.28
2 years ago
0.0.29
2 years ago
0.0.21
3 years ago
0.0.22
3 years ago
0.0.23
2 years ago
0.0.24
2 years ago
0.0.25
2 years ago
0.0.26
2 years ago
0.0.27
2 years ago
0.0.20
3 years ago
0.0.18
3 years ago
0.0.19
3 years ago
0.0.17
3 years ago
0.0.16
3 years ago
0.0.15
3 years ago
0.0.14
3 years ago
0.0.13
3 years ago
0.0.12
3 years ago