mirror of
https://github.com/IrosTheBeggar/mStream.git
synced 2025-10-27 07:31:02 +00:00
remove another line of code with too new features
This commit is contained in:
parent
2d36904557
commit
138ca361de
@ -77,7 +77,7 @@ exports.serveIt = async configFile => {
|
||||
if (req.path.endsWith('//')) {
|
||||
// find all trailing slashes at the end of the url
|
||||
const matchEnd = req.path.match(/(\/)+$/g);
|
||||
const queryString = req.url.match(/(\?.*)/g) ?? '';
|
||||
const queryString = req.url.match(/(\?.*)/g) === null ? '' : req.url.match(/(\?.*)/g);
|
||||
// redirect to a more sane URL
|
||||
return res.redirect(301, req.path.slice(0, (matchEnd[0].length - 1)*-1) + queryString);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user