mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
Updated topic and category controller to not redirect on incorrect
slug if the call is made via API route. Cold load? Anything goes.
This commit is contained in:
@@ -54,7 +54,7 @@ topicsController.get = function(req, res, callback) {
|
||||
return helpers.notAllowed(req, res);
|
||||
}
|
||||
|
||||
if ((!req.params.slug || results.topic.slug !== tid + '/' + req.params.slug) && (results.topic.slug && results.topic.slug !== tid + '/')) {
|
||||
if (!res.locals.isAPI && (!req.params.slug || results.topic.slug !== tid + '/' + req.params.slug) && (results.topic.slug && results.topic.slug !== tid + '/')) {
|
||||
var url = '/topic/' + encodeURI(results.topic.slug);
|
||||
if (req.params.post_index){
|
||||
url += '/'+req.params.post_index;
|
||||
|
||||
Reference in New Issue
Block a user