Handle aliases in websocket API

This commit is contained in:
Radon Rosborough 2021-08-30 21:35:03 -07:00
parent 48a1433967
commit cc8d54ef75
1 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,10 @@ function addWebsocket(baseApp, httpsServer) {
const app = ws(baseApp, httpsServer).app;
app.ws("/api/v1/ws", (ws, req) => {
try {
const lang = req.query.get("lang");
let lang = req.query.get("lang");
if (aliases[lang]) {
lang = aliases[lang];
}
if (!lang) {
ws.send(
JSON.stringify({