@@ -193,18 +193,17 @@ export function createHandler<T extends DashSqlite>(db: T, env: Record<string, s
193193 return new Response ( "ok" , {
194194 status : 200 ,
195195 headers : {
196- ...CORS ,
197196 "Content-Type" : "application/json" ,
198197 } ,
199198 } ) ;
200199 }
201200 if ( ! [ "POST" , "PUT" ] . includes ( req . method ) ) {
202- return new Response ( "Invalid request" , { status : 404 , headers : CORS } ) ;
201+ return new Response ( "Invalid request" , { status : 404 } ) ;
203202 }
204203 const rJso = await exception2Result ( async ( ) => await req . json ( ) ) ;
205204 if ( rJso . isErr ( ) ) {
206205 logger . Error ( ) . Err ( rJso . Err ( ) ) . Msg ( "createhandler-Error" ) ;
207- return new Response ( "Invalid request" , { status : 404 , headers : CORS } ) ;
206+ return new Response ( "Invalid request" , { status : 404 } ) ;
208207 }
209208 const jso = rJso . Ok ( ) ;
210209
@@ -277,7 +276,7 @@ export function createHandler<T extends DashSqlite>(db: T, env: Record<string, s
277276 break ;
278277
279278 default :
280- return new Response ( "Invalid request" , { status : 400 , headers : CORS } ) ;
279+ return new Response ( "Invalid request" , { status : 400 } ) ;
281280 }
282281 try {
283282 const rRes = await res ;
@@ -294,7 +293,6 @@ export function createHandler<T extends DashSqlite>(db: T, env: Record<string, s
294293 {
295294 status : 500 ,
296295 headers : {
297- ...CORS ,
298296 "Server-Timing" : `total;dur=${ duration . toFixed ( 2 ) } ` ,
299297 } ,
300298 } ,
@@ -309,7 +307,6 @@ export function createHandler<T extends DashSqlite>(db: T, env: Record<string, s
309307 return new Response ( JSON . stringify ( rRes . Ok ( ) ) , {
310308 status : 200 ,
311309 headers : {
312- ...CORS ,
313310 "Content-Type" : "application/json" ,
314311 "Server-Timing" : `total;dur=${ duration . toFixed ( 2 ) } ` ,
315312 } ,
@@ -326,7 +323,6 @@ export function createHandler<T extends DashSqlite>(db: T, env: Record<string, s
326323 {
327324 status : 500 ,
328325 headers : {
329- ...CORS ,
330326 "Content-Type" : "application/json" ,
331327 "Server-Timing" : `total;dur=${ duration . toFixed ( 2 ) } ` ,
332328 } ,
0 commit comments