@@ -137,26 +137,26 @@ export function marketsCors(): ReturnType<typeof createCorsAllowlistMiddleware>
137137}
138138
139139/**
140- * Pre-configured CORS middleware for the audit endpoint.
141- * Reads allowed origins from the `AUDIT_CORS_ALLOWED_ORIGINS ` env variable.
142- * When the allowlist is empty, all cross-origin requests to /api/audit are denied.
140+ * Pre-configured CORS middleware for the notifications endpoint.
141+ * Reads allowed origins from the `NOTIFICATIONS_CORS_ALLOWED_ORIGINS ` env variable.
142+ * When the allowlist is empty, all cross-origin requests to /api/notifications are denied.
143143 */
144- let auditCorsMiddleware : ReturnType < typeof createCorsAllowlistMiddleware > | null = null ;
144+ let notificationsCorsMiddleware : ReturnType < typeof createCorsAllowlistMiddleware > | null = null ;
145145
146- export function auditCors ( ) : ReturnType < typeof createCorsAllowlistMiddleware > {
147- if ( ! auditCorsMiddleware ) {
148- const raw = env . AUDIT_CORS_ALLOWED_ORIGINS ?? "" ;
146+ export function notificationsCors ( ) : ReturnType < typeof createCorsAllowlistMiddleware > {
147+ if ( ! notificationsCorsMiddleware ) {
148+ const raw = env . NOTIFICATIONS_CORS_ALLOWED_ORIGINS ?? "" ;
149149 const allowedOrigins = raw
150150 . split ( "," )
151151 . map ( ( o ) => o . trim ( ) )
152152 . filter ( ( o ) => o . length > 0 ) ;
153- auditCorsMiddleware = createCorsAllowlistMiddleware ( {
153+ notificationsCorsMiddleware = createCorsAllowlistMiddleware ( {
154154 allowedOrigins,
155155 allowCredentials : true ,
156156 maxAgeSeconds : 600 ,
157157 } ) ;
158158 }
159- return auditCorsMiddleware ;
159+ return notificationsCorsMiddleware ;
160160}
161161
162162export const enforceCors = marketsCors ( ) ;
0 commit comments