Merge pull request 'Support redd.it short url redirections' (#290) from austinhuang.me/teddit:austinhuang.me-patch-3 into main
Reviewed-on: https://codeberg.org/teddit/teddit/pulls/290
This commit is contained in:
commit
e87b811883
|
@ -32,6 +32,16 @@ homeRoute.get('/:sort?', async (req, res, next) => {
|
|||
}
|
||||
}
|
||||
|
||||
let is_comment =
|
||||
sortby.length == 6 &&
|
||||
sortby != "rising"
|
||||
? true
|
||||
: false;
|
||||
|
||||
if (is_comment) {
|
||||
return res.redirect('/comments/' + sortby);
|
||||
}
|
||||
|
||||
let d = `&after=${after}`;
|
||||
if (before) {
|
||||
d = `&before=${before}`;
|
||||
|
|
Loading…
Reference in New Issue