mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-14 09:18:26 +00:00
Add redirect from root path to X.com/isocortexx
This commit is contained in:
parent
9804523881
commit
162a775126
@ -118,6 +118,10 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
|
|||||||
...corsConfig,
|
...corsConfig,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
app.get('/', (req, res) => {
|
||||||
|
res.redirect(302, 'https://x.com/isocortexx');
|
||||||
|
});
|
||||||
|
|
||||||
app.post('/', (req, res, next) => {
|
app.post('/', (req, res, next) => {
|
||||||
if (!acceptRegex.test(req.header('Accept'))) {
|
if (!acceptRegex.test(req.header('Accept'))) {
|
||||||
return fail(res, "error.api.header.accept");
|
return fail(res, "error.api.header.accept");
|
||||||
@ -170,7 +174,7 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
|
|||||||
return fail(res, "error.api.auth.jwt.invalid");
|
return fail(res, "error.api.auth.jwt.invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
const [ type, token, ...rest ] = authorization.split(" ");
|
const [type, token, ...rest] = authorization.split(" ");
|
||||||
if (!token || type.toLowerCase() !== 'bearer' || rest.length) {
|
if (!token || type.toLowerCase() !== 'bearer' || rest.length) {
|
||||||
return fail(res, "error.api.auth.jwt.invalid");
|
return fail(res, "error.api.auth.jwt.invalid");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user