mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: upgraded @types/cors
This commit is contained in:
parent
38b1c98cb6
commit
9b6eab27bc
9
package-lock.json
generated
9
package-lock.json
generated
@ -1176,12 +1176,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/cors": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.8.tgz",
|
||||
"integrity": "sha512-fO3gf3DxU2Trcbr75O7obVndW/X5k8rJNZkLXlQWStTHhP71PkRqjwPIEI0yMnJdg9R9OasjU+Bsr+Hr1xy/0w==",
|
||||
"requires": {
|
||||
"@types/express": "*"
|
||||
}
|
||||
"version": "2.8.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.9.tgz",
|
||||
"integrity": "sha512-zurD1ibz21BRlAOIKP8yhrxlqKx6L9VCwkB5kMiP6nZAhoF5MvC7qS1qPA7nRcr1GJolfkQC7/EAL4hdYejLtg=="
|
||||
},
|
||||
"@types/express": {
|
||||
"version": "4.17.8",
|
||||
|
@ -78,7 +78,7 @@
|
||||
"@solid/identity-token-verifier": "^0.5.1",
|
||||
"@types/arrayify-stream": "^1.0.0",
|
||||
"@types/async-lock": "^1.1.2",
|
||||
"@types/cors": "^2.8.6",
|
||||
"@types/cors": "^2.8.9",
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/mime-types": "^2.1.0",
|
||||
"@types/n3": "^1.4.4",
|
||||
|
@ -1,6 +1,5 @@
|
||||
import cors from 'cors';
|
||||
import type { CorsOptions } from 'cors';
|
||||
import type { RequestHandler } from 'express';
|
||||
import type { CorsOptions, CorsRequest } from 'cors';
|
||||
import type { HttpHandlerInput } from '../HttpHandler';
|
||||
import { HttpHandler } from '../HttpHandler';
|
||||
|
||||
@ -30,7 +29,15 @@ interface SimpleCorsOptions {
|
||||
* Full details: https://solid.github.io/specification/protocol#cors-server
|
||||
*/
|
||||
export class CorsHandler extends HttpHandler {
|
||||
private readonly corsHandler: RequestHandler;
|
||||
private readonly corsHandler: (
|
||||
req: CorsRequest,
|
||||
res: {
|
||||
statusCode?: number;
|
||||
setHeader: (key: string, value: string) => any;
|
||||
end: () => any;
|
||||
},
|
||||
next: (err?: any) => any,
|
||||
) => void;
|
||||
|
||||
public constructor(options: SimpleCorsOptions = {}) {
|
||||
super();
|
||||
|
Loading…
x
Reference in New Issue
Block a user