From 6427728bcc56249bb4acb4adcc817bd9c2221f2f Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Thu, 12 Dec 2024 10:05:18 +0200 Subject: [PATCH] fix(cors): Removed custom OPTIONS preflight handler in favor of default Hapi CORS handler --- workers/api.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/workers/api.js b/workers/api.js index cd4005d5..666df600 100644 --- a/workers/api.js +++ b/workers/api.js @@ -1293,25 +1293,6 @@ const init = async () => { } }); - server.route({ - method: 'OPTIONS', - path: '/v1/{any*}', - handler: async (request, reply) => { - const method = request.headers['access-control-request-method']; - const response = reply.response(Buffer.alloc(0)); - - if (method) { - response.header('Access-Control-Allow-Methods', method); - } - - return response.code(200); - }, - options: { - auth: false, - cors: CORS_CONFIG - } - }); - server.route({ method: 'GET', path: '/health',