File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,15 +24,15 @@ export interface Routing {
2424
2525export type Parsers = Partial < Record < ContentType , RequestHandler [ ] > > ;
2626
27- const lineUp = ( methods : Array < CORSMethod > ) =>
27+ const lineUp = ( methods : CORSMethod [ ] ) =>
2828 methods // auxiliary methods go last
2929 . sort ( ( a , b ) => + isMethod ( b ) - + isMethod ( a ) || a . localeCompare ( b ) )
3030 . join ( ", " )
3131 . toUpperCase ( ) ;
3232
3333/** @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 */
3434export const createWrongMethodHandler =
35- ( allowedMethods : Array < CORSMethod > ) : RequestHandler =>
35+ ( allowedMethods : CORSMethod [ ] ) : RequestHandler =>
3636 ( { method } , res , next ) => {
3737 const Allow = lineUp ( allowedMethods ) ;
3838 res . set ( { Allow } ) ; // in case of a custom errorHandler configured that does not care about headers in error
@@ -42,7 +42,7 @@ export const createWrongMethodHandler =
4242 next ( error ) ;
4343 } ;
4444
45- const makeCorsHeaders = ( accessMethods : Array < CORSMethod > ) => ( {
45+ const makeCorsHeaders = ( accessMethods : CORSMethod [ ] ) => ( {
4646 "Access-Control-Allow-Origin" : "*" ,
4747 "Access-Control-Allow-Methods" : lineUp ( accessMethods ) ,
4848 "Access-Control-Allow-Headers" : "content-type" ,
You can’t perform that action at this time.
0 commit comments