1
0

change || to ??

This commit is contained in:
2023-02-02 18:31:33 +01:00
parent 7edfc835fa
commit f3181ca9a5

View File

@@ -287,11 +287,11 @@ export class Router<TEnv = any, TExt = any> {
public cors(config?: RouterCorsConfig): Router<TEnv, TExt> { public cors(config?: RouterCorsConfig): Router<TEnv, TExt> {
this.corsEnabled = true this.corsEnabled = true
this.corsConfig = { this.corsConfig = {
allowOrigin: config?.allowOrigin || '*', allowOrigin: config?.allowOrigin ?? '*',
allowMethods: config?.allowMethods || '*', allowMethods: config?.allowMethods ?? '*',
allowHeaders: config?.allowHeaders || '*', allowHeaders: config?.allowHeaders ?? '*',
maxAge: config?.maxAge || 86400, maxAge: config?.maxAge ?? 86400,
optionsSuccessStatus: config?.optionsSuccessStatus || 204 optionsSuccessStatus: config?.optionsSuccessStatus ?? 204
} }
return this return this
} }