@aomex/cors 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +110 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @aomex/cors
|
|
2
|
+
|
|
3
|
+
## 0.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8a6f70c`](https://github.com/aomex/aomex/commit/8a6f70c32145b26b1896e976bc6f6454516c7a4d) Thanks [@geekact](https://github.com/geekact)! - 增加 web 插件 cors
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`4735157`](https://github.com/aomex/aomex/commit/4735157c52d0abecc41d6c7f416280ebfd6ee696), [`d6ac7b5`](https://github.com/aomex/aomex/commit/d6ac7b5403334b51fa15dbe82dd6b5b6d048f661), [`9254754`](https://github.com/aomex/aomex/commit/9254754d234fc0062eb5d600284ee8453825306c), [`d1ce4e2`](https://github.com/aomex/aomex/commit/d1ce4e2276f93c44e67ea06666d048917fa94e53), [`6056f55`](https://github.com/aomex/aomex/commit/6056f556577865220d6b5be2a4eafad9e4dbf8d4), [`1c67399`](https://github.com/aomex/aomex/commit/1c673992c4b313c2accb4cbc1fc66537a9886c29), [`352642a`](https://github.com/aomex/aomex/commit/352642abf2ccb3fe97e2d83a691d8428ccfc9758)]:
|
|
10
|
+
- @aomex/web@0.0.3
|
|
11
|
+
- @aomex/core@0.0.2
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 geekact
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { WebContext, WebMiddleware } from '@aomex/web';
|
|
2
|
+
|
|
3
|
+
interface CorsOptions {
|
|
4
|
+
/**
|
|
5
|
+
* `Access-Control-Allow-Origin`, default is request Origin header.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* If a function is provided, it will be called for each request with
|
|
9
|
+
* the koa context object. It may return a string or a promise that
|
|
10
|
+
* will resolve with a string.
|
|
11
|
+
*/
|
|
12
|
+
origin?: ((ctx: WebContext) => string) | ((ctx: WebContext) => PromiseLike<string>) | string;
|
|
13
|
+
/**
|
|
14
|
+
* `Access-Control-Allow-Methods`, default is
|
|
15
|
+
* 'GET,HEAD,PUT,POST,DELETE,PATCH'
|
|
16
|
+
*/
|
|
17
|
+
allowMethods?: string[] | string;
|
|
18
|
+
/**
|
|
19
|
+
* `Access-Control-Expose-Headers`
|
|
20
|
+
*/
|
|
21
|
+
exposeHeaders?: string[] | string;
|
|
22
|
+
/**
|
|
23
|
+
* `Access-Control-Allow-Headers`
|
|
24
|
+
*/
|
|
25
|
+
allowHeaders?: string[] | string;
|
|
26
|
+
/**
|
|
27
|
+
* `Access-Control-Max-Age` in seconds
|
|
28
|
+
*/
|
|
29
|
+
maxAge?: number | string;
|
|
30
|
+
/**
|
|
31
|
+
* `Access-Control-Allow-Credentials`
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* If a function is provided, it will be called for each request with
|
|
35
|
+
* the koa context object. It may return a boolean or a promise that
|
|
36
|
+
* will resolve with a boolean.
|
|
37
|
+
*/
|
|
38
|
+
credentials?: ((ctx: WebContext) => boolean) | ((ctx: WebContext) => PromiseLike<boolean>) | boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Add set headers to `err.header` if an error is thrown
|
|
41
|
+
*/
|
|
42
|
+
keepHeadersOnError?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Add `Cross-Origin-Opener-Policy` & `Cross-Origin-Embedder-Policy` to response headers
|
|
45
|
+
*
|
|
46
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/Planned_changes
|
|
47
|
+
*/
|
|
48
|
+
secureContext?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Handle `Access-Control-Request-Private-Network` request by return `Access-Control-Allow-Private-Network`
|
|
51
|
+
*
|
|
52
|
+
* @see https://wicg.github.io/private-network-access/
|
|
53
|
+
*/
|
|
54
|
+
privateNetworkAccess?: boolean;
|
|
55
|
+
}
|
|
56
|
+
declare const cors: (options?: CorsOptions) => WebMiddleware;
|
|
57
|
+
|
|
58
|
+
export { CorsOptions, cors };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { middleware } from "@aomex/core";
|
|
3
|
+
var defaults = {
|
|
4
|
+
allowMethods: "GET,HEAD,PUT,POST,DELETE,PATCH",
|
|
5
|
+
secureContext: false
|
|
6
|
+
};
|
|
7
|
+
var cors = (options = {}) => {
|
|
8
|
+
options = {
|
|
9
|
+
...defaults,
|
|
10
|
+
...options
|
|
11
|
+
};
|
|
12
|
+
["exposeHeaders", "allowMethods", "allowHeaders"].forEach((key) => {
|
|
13
|
+
const value = options[key];
|
|
14
|
+
if (Array.isArray(value)) {
|
|
15
|
+
options[key] = value.join(",");
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
if (options.maxAge) {
|
|
19
|
+
options.maxAge = String(options.maxAge);
|
|
20
|
+
}
|
|
21
|
+
options.keepHeadersOnError = options.keepHeadersOnError !== false;
|
|
22
|
+
return middleware.web(async (ctx, next) => {
|
|
23
|
+
const { request, response } = ctx;
|
|
24
|
+
const requestOrigin = request.headers["origin"];
|
|
25
|
+
response.vary("origin");
|
|
26
|
+
if (!requestOrigin)
|
|
27
|
+
return next();
|
|
28
|
+
let origin;
|
|
29
|
+
if (typeof options.origin === "function") {
|
|
30
|
+
origin = await options.origin(ctx);
|
|
31
|
+
if (!origin)
|
|
32
|
+
return next();
|
|
33
|
+
} else {
|
|
34
|
+
origin = options.origin || requestOrigin;
|
|
35
|
+
}
|
|
36
|
+
let credentials;
|
|
37
|
+
if (typeof options.credentials === "function") {
|
|
38
|
+
credentials = await options.credentials(ctx);
|
|
39
|
+
} else {
|
|
40
|
+
credentials = !!options.credentials;
|
|
41
|
+
}
|
|
42
|
+
const headersSet = {};
|
|
43
|
+
function setAndRecordHeader(key, value) {
|
|
44
|
+
response.setHeader(key, value);
|
|
45
|
+
headersSet[key] = value;
|
|
46
|
+
}
|
|
47
|
+
if (request.method !== "OPTIONS") {
|
|
48
|
+
setAndRecordHeader("Access-Control-Allow-Origin", origin);
|
|
49
|
+
credentials && setAndRecordHeader("Access-Control-Allow-Credentials", "true");
|
|
50
|
+
if (options.exposeHeaders) {
|
|
51
|
+
setAndRecordHeader(
|
|
52
|
+
"Access-Control-Expose-Headers",
|
|
53
|
+
options.exposeHeaders
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
if (options.secureContext) {
|
|
57
|
+
setAndRecordHeader("Cross-Origin-Opener-Policy", "same-origin");
|
|
58
|
+
setAndRecordHeader("Cross-Origin-Embedder-Policy", "require-corp");
|
|
59
|
+
}
|
|
60
|
+
if (!options.keepHeadersOnError)
|
|
61
|
+
return next();
|
|
62
|
+
return next().catch((err) => {
|
|
63
|
+
const errHeadersSet = err.headers || {};
|
|
64
|
+
const varyWithOrigin = response.varyAppend(
|
|
65
|
+
errHeadersSet["vary"] || errHeadersSet["Vary"] || "",
|
|
66
|
+
"Origin"
|
|
67
|
+
);
|
|
68
|
+
delete errHeadersSet["Vary"];
|
|
69
|
+
err.headers = {
|
|
70
|
+
...errHeadersSet,
|
|
71
|
+
...headersSet,
|
|
72
|
+
...{ vary: varyWithOrigin }
|
|
73
|
+
};
|
|
74
|
+
return Promise.reject(err);
|
|
75
|
+
});
|
|
76
|
+
} else {
|
|
77
|
+
if (!request.headers["access-control-request-method"])
|
|
78
|
+
return next();
|
|
79
|
+
response.setHeader("Access-Control-Allow-Origin", origin);
|
|
80
|
+
if (credentials === true) {
|
|
81
|
+
response.setHeader("Access-Control-Allow-Credentials", "true");
|
|
82
|
+
}
|
|
83
|
+
if (options.maxAge) {
|
|
84
|
+
response.setHeader("Access-Control-Max-Age", options.maxAge);
|
|
85
|
+
}
|
|
86
|
+
if (options.privateNetworkAccess && request.headers["access-control-request-private-network"]) {
|
|
87
|
+
response.setHeader("Access-Control-Allow-Private-Network", "true");
|
|
88
|
+
}
|
|
89
|
+
if (options.allowMethods) {
|
|
90
|
+
response.setHeader(
|
|
91
|
+
"Access-Control-Allow-Methods",
|
|
92
|
+
options.allowMethods
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (options.secureContext) {
|
|
96
|
+
setAndRecordHeader("Cross-Origin-Opener-Policy", "same-origin");
|
|
97
|
+
setAndRecordHeader("Cross-Origin-Embedder-Policy", "require-corp");
|
|
98
|
+
}
|
|
99
|
+
const allowHeaders = options.allowHeaders || request.headers["access-control-request-headers"];
|
|
100
|
+
if (allowHeaders) {
|
|
101
|
+
response.setHeader("Access-Control-Allow-Headers", allowHeaders);
|
|
102
|
+
}
|
|
103
|
+
ctx.send(204);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
cors
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { HttpError, WebContext, WebMiddleware } from '@aomex/web';\nimport { middleware } from '@aomex/core';\n\nexport interface CorsOptions {\n /**\n * `Access-Control-Allow-Origin`, default is request Origin header.\n *\n * @remarks\n * If a function is provided, it will be called for each request with\n * the koa context object. It may return a string or a promise that\n * will resolve with a string.\n */\n origin?:\n | ((ctx: WebContext) => string)\n | ((ctx: WebContext) => PromiseLike<string>)\n | string;\n\n /**\n * `Access-Control-Allow-Methods`, default is\n * 'GET,HEAD,PUT,POST,DELETE,PATCH'\n */\n allowMethods?: string[] | string;\n\n /**\n * `Access-Control-Expose-Headers`\n */\n exposeHeaders?: string[] | string;\n\n /**\n * `Access-Control-Allow-Headers`\n */\n allowHeaders?: string[] | string;\n\n /**\n * `Access-Control-Max-Age` in seconds\n */\n maxAge?: number | string;\n\n /**\n * `Access-Control-Allow-Credentials`\n *\n * @remarks\n * If a function is provided, it will be called for each request with\n * the koa context object. It may return a boolean or a promise that\n * will resolve with a boolean.\n */\n credentials?:\n | ((ctx: WebContext) => boolean)\n | ((ctx: WebContext) => PromiseLike<boolean>)\n | boolean;\n\n /**\n * Add set headers to `err.header` if an error is thrown\n */\n keepHeadersOnError?: boolean;\n\n /**\n * Add `Cross-Origin-Opener-Policy` & `Cross-Origin-Embedder-Policy` to response headers\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/Planned_changes\n */\n secureContext?: boolean;\n\n /**\n * Handle `Access-Control-Request-Private-Network` request by return `Access-Control-Allow-Private-Network`\n *\n * @see https://wicg.github.io/private-network-access/\n */\n privateNetworkAccess?: boolean;\n}\n\nconst defaults: CorsOptions = {\n allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',\n secureContext: false,\n};\n\nexport const cors = (options: CorsOptions = {}): WebMiddleware => {\n options = {\n ...defaults,\n ...options,\n };\n\n (<const>['exposeHeaders', 'allowMethods', 'allowHeaders']).forEach((key) => {\n const value = options[key];\n if (Array.isArray(value)) {\n options[key] = value.join(',');\n }\n });\n\n if (options.maxAge) {\n options.maxAge = String(options.maxAge);\n }\n\n options.keepHeadersOnError = options.keepHeadersOnError !== false;\n\n return middleware.web(async (ctx, next) => {\n const { request, response } = ctx;\n const requestOrigin = request.headers['origin'];\n\n // Always set Vary header\n // https://github.com/rs/cors/issues/10\n response.vary('origin');\n\n if (!requestOrigin) return next();\n\n let origin: string;\n if (typeof options.origin === 'function') {\n origin = await options.origin(ctx);\n if (!origin) return next();\n } else {\n origin = options.origin || requestOrigin;\n }\n\n let credentials;\n if (typeof options.credentials === 'function') {\n credentials = await options.credentials(ctx);\n } else {\n credentials = !!options.credentials;\n }\n\n const headersSet: Record<string, any> = {};\n\n function setAndRecordHeader(key: string, value: any) {\n response.setHeader(key, value);\n headersSet[key] = value;\n }\n\n if (request.method !== 'OPTIONS') {\n // Simple Cross-Origin Request, Actual Request, and Redirects\n setAndRecordHeader('Access-Control-Allow-Origin', origin);\n credentials &&\n setAndRecordHeader('Access-Control-Allow-Credentials', 'true');\n\n if (options.exposeHeaders) {\n setAndRecordHeader(\n 'Access-Control-Expose-Headers',\n options.exposeHeaders,\n );\n }\n\n if (options.secureContext) {\n setAndRecordHeader('Cross-Origin-Opener-Policy', 'same-origin');\n setAndRecordHeader('Cross-Origin-Embedder-Policy', 'require-corp');\n }\n\n if (!options.keepHeadersOnError) return next();\n\n return next().catch((err: HttpError) => {\n const errHeadersSet = err.headers || {};\n const varyWithOrigin = response.varyAppend(\n errHeadersSet['vary'] || errHeadersSet['Vary'] || '',\n 'Origin',\n );\n delete errHeadersSet['Vary'];\n\n err.headers = {\n ...errHeadersSet,\n ...headersSet,\n ...{ vary: varyWithOrigin },\n };\n\n return Promise.reject(err);\n });\n } else {\n if (!request.headers['access-control-request-method']) return next();\n\n response.setHeader('Access-Control-Allow-Origin', origin);\n\n if (credentials === true) {\n response.setHeader('Access-Control-Allow-Credentials', 'true');\n }\n\n if (options.maxAge) {\n response.setHeader('Access-Control-Max-Age', options.maxAge);\n }\n\n if (\n options.privateNetworkAccess &&\n request.headers['access-control-request-private-network']\n ) {\n response.setHeader('Access-Control-Allow-Private-Network', 'true');\n }\n\n if (options.allowMethods) {\n response.setHeader(\n 'Access-Control-Allow-Methods',\n options.allowMethods,\n );\n }\n\n if (options.secureContext) {\n setAndRecordHeader('Cross-Origin-Opener-Policy', 'same-origin');\n setAndRecordHeader('Cross-Origin-Embedder-Policy', 'require-corp');\n }\n\n const allowHeaders =\n options.allowHeaders ||\n request.headers['access-control-request-headers'];\n if (allowHeaders) {\n response.setHeader('Access-Control-Allow-Headers', allowHeaders);\n }\n\n ctx.send(204);\n }\n });\n};\n"],"mappings":"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","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aomex/cors",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "跨站资源共享",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cors"
|
|
7
|
+
],
|
|
8
|
+
"repository": "git@github.com:aomex/aomex.git",
|
|
9
|
+
"homepage": "https://aomex.js.org",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"LICENSE",
|
|
24
|
+
"package.json",
|
|
25
|
+
"README.md",
|
|
26
|
+
"CHANGELOG.md"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@aomex/core": "^0.0.2",
|
|
33
|
+
"@aomex/web": "^0.0.3"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@aomex/core": "^0.0.2",
|
|
37
|
+
"@aomex/web": "^0.0.3",
|
|
38
|
+
"@types/supertest": "^2.0.12",
|
|
39
|
+
"supertest": "^6.2.4",
|
|
40
|
+
"vitest": "^0.28.4"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {}
|
|
43
|
+
}
|