From fec07d0e10693fb0fcf0bb9fafdb88a3726935cb Mon Sep 17 00:00:00 2001 From: jj Date: Mon, 16 Dec 2024 17:45:02 +0000 Subject: [PATCH] api: add cors headers for tunnels --- api/src/core/api.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/src/core/api.js b/api/src/core/api.js index b93ff2ca..fc890ad2 100644 --- a/api/src/core/api.js +++ b/api/src/core/api.js @@ -264,6 +264,14 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => { } }) + app.use('/tunnel', cors({ + methods: ['GET'], + exposedHeaders: [ + 'Estimated-Content-Length' + ], + ...corsConfig, + })); + app.get('/tunnel', apiTunnelLimiter, async (req, res) => { const id = String(req.query.id); const exp = String(req.query.exp);