api: add cors headers for tunnels

This commit is contained in:
jj 2024-12-16 17:45:02 +00:00
parent f5b47a2b7e
commit fec07d0e10
No known key found for this signature in database

View file

@ -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);