diff --git a/api/src/core/api.js b/api/src/core/api.js index 51ec1697..fdd13ce1 100644 --- a/api/src/core/api.js +++ b/api/src/core/api.js @@ -105,6 +105,18 @@ export const runAPI = (express, app, __dirname) => { app.post('/', apiLimiter); app.use('/tunnel', apiLimiterStream); + app.post('/', (req, res, next) => { + if (!acceptRegex.test(req.header('Accept'))) { + return fail(res, "error.api.header.accept"); + } + + if (!acceptRegex.test(req.header('Content-Type'))) { + return fail(res, "error.api.header.content_type"); + } + + next(); + }); + app.post('/', (req, res, next) => { if (!env.turnstileSecret || !env.jwtSecret) { return next(); @@ -128,14 +140,6 @@ export const runAPI = (express, app, __dirname) => { return fail(res, "error.api.auth.jwt.invalid"); } - if (!acceptRegex.test(req.header('Accept'))) { - return fail(res, "error.api.header.accept"); - } - - if (!acceptRegex.test(req.header('Content-Type'))) { - return fail(res, "error.api.header.content_type"); - } - req.authorized = true; } catch { return fail(res, "error.api.generic"); diff --git a/web/changelogs/10.0.md b/web/changelogs/10.0.md index 1a178b75..86da6d3b 100644 --- a/web/changelogs/10.0.md +++ b/web/changelogs/10.0.md @@ -47,7 +47,7 @@ and for nerds, we have a giant list of backend changes (that we are also excited this update allows us to actually innovate and develop new & exciting features. we are no longer held back by the legacy codebase. first feature of such kind is on-device remuxing. go check it out! -oh yeah, we now have 2.5 million monthly users. kind of insane. +oh yeah, we now have over 2 million monthly users. kind of insane. we hope you enjoy this update as much as we enjoyed making it. it was a really fun summer project for both of us. diff --git a/web/i18n/en/settings.json b/web/i18n/en/settings.json index fea15d29..90b2e0f6 100644 --- a/web/i18n/en/settings.json +++ b/web/i18n/en/settings.json @@ -88,10 +88,10 @@ "accessibility.motion.description": "disables animations and transitions whenever possible.", "language": "language", - "language.auto.title": "use default browser language", - "language.auto.description": "automatically picks the best language for you. if preferred browser language isn't available, english is used instead.", + "language.auto.title": "automatic selection", + "language.auto.description": "cobalt will use your browser's default language if translation is available. if not, english will be used instead.", "language.preferred.title": "preferred language", - "language.preferred.description": "if any text isn’t translated to the preferred language, it will fall back to english.", + "language.preferred.description": "this language will be used when automatic selection is disabled. any text that isn't translated will be displayed in english.", "privacy.analytics": "anonymous traffic analytics", "privacy.analytics.title": "don't contribute to analytics",