Skip to content

Node.js based forum software built for the modern web

fix: redirect to /api/world for API requests

Opliko495d5435f549
diff --git a/src/controllers/category.js b/src/controllers/category.js
index e969e95265..9bf532cadb 100644
--- a/src/controllers/category.js
+++ b/src/controllers/category.js
@@ -27,7 +27,7 @@ const validSorts = [
categoryController.get = async function (req, res, next) {
const cid = req.params.category_id;
if (cid === '-1') {
- return helpers.redirect(res, `/world?${qs.stringify(req.query)}`);
+ return helpers.redirect(res, `${res.locals.isAPI ? '/api' : ''}/world?${qs.stringify(req.query)}`);
}
let currentPage = parseInt(req.query.page, 10) || 1;