mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-03-05 13:30:33 -05:00
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:
@@ -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}`;
|
||||
|
||||
Reference in New Issue
Block a user