mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-15 11:25:17 +00:00
api: add cors headers for tunnels
This commit is contained in:
parent
f5b47a2b7e
commit
fec07d0e10
|
@ -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) => {
|
app.get('/tunnel', apiTunnelLimiter, async (req, res) => {
|
||||||
const id = String(req.query.id);
|
const id = String(req.query.id);
|
||||||
const exp = String(req.query.exp);
|
const exp = String(req.query.exp);
|
||||||
|
|
Loading…
Reference in a new issue