mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 11:18:28 +00:00
api: update /api/best_audio route error handling
This commit is contained in:
parent
c98b0eb120
commit
a2eb743222
@ -145,6 +145,13 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) {
|
||||
|
||||
app.get('/api/best_audio', async (req, res) => {
|
||||
|
||||
const lang = languageCode(req);
|
||||
|
||||
const fail = (t) => {
|
||||
const { status, body } = createResponse("error", { t: loc(lang, t) });
|
||||
res.status(status).json(body);
|
||||
}
|
||||
|
||||
if (!req.query.url) { return res.status(400).send('Missing required "url" query parameter'); }
|
||||
|
||||
const request = req.query;
|
||||
|
Loading…
Reference in New Issue
Block a user