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:
committed by
Joachim Van Herwegen
parent
38b1c98cb6
commit
9b6eab27bc
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user