mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: #7467, pass query params when redirecting to posts
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const querystring = require('querystring');
|
||||
|
||||
const posts = require('../posts');
|
||||
const privileges = require('../privileges');
|
||||
const helpers = require('./helpers');
|
||||
@@ -22,7 +24,9 @@ postsController.redirectToPost = async function (req, res, next) {
|
||||
if (!canRead) {
|
||||
return helpers.notAllowed(req, res);
|
||||
}
|
||||
helpers.redirect(res, path);
|
||||
|
||||
const qs = querystring.stringify(req.query);
|
||||
helpers.redirect(res, qs ? path + '?' + qs : path);
|
||||
};
|
||||
|
||||
postsController.getRecentPosts = async function (req, res) {
|
||||
|
||||
@@ -169,6 +169,7 @@ async function setupMockDefaults() {
|
||||
meta.config.postDelay = 0;
|
||||
meta.config.initialPostDelay = 0;
|
||||
meta.config.newbiePostDelay = 0;
|
||||
meta.config.autoDetectLang = 0;
|
||||
|
||||
await enableDefaultPlugins();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user