Merge branch 'imputnet:main' into main

This commit is contained in:
Sticks 2024-09-17 12:19:43 -05:00 committed by GitHub
commit 1bcceb1aff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 12 deletions

View File

@ -105,6 +105,18 @@ export const runAPI = (express, app, __dirname) => {
app.post('/', apiLimiter); app.post('/', apiLimiter);
app.use('/tunnel', apiLimiterStream); 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) => { app.post('/', (req, res, next) => {
if (!env.turnstileSecret || !env.jwtSecret) { if (!env.turnstileSecret || !env.jwtSecret) {
return next(); return next();
@ -128,14 +140,6 @@ export const runAPI = (express, app, __dirname) => {
return fail(res, "error.api.auth.jwt.invalid"); 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; req.authorized = true;
} catch { } catch {
return fail(res, "error.api.generic"); return fail(res, "error.api.generic");

View File

@ -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! 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. we hope you enjoy this update as much as we enjoyed making it. it was a really fun summer project for both of us.

View File

@ -88,10 +88,10 @@
"accessibility.motion.description": "disables animations and transitions whenever possible.", "accessibility.motion.description": "disables animations and transitions whenever possible.",
"language": "language", "language": "language",
"language.auto.title": "use default browser language", "language.auto.title": "automatic selection",
"language.auto.description": "automatically picks the best language for you. if preferred browser language isn't available, english is used instead.", "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.title": "preferred language",
"language.preferred.description": "if any text isnt 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": "anonymous traffic analytics",
"privacy.analytics.title": "don't contribute to analytics", "privacy.analytics.title": "don't contribute to analytics",