Skip to content

Commit

Permalink
fix(#35): base url in redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
jannis-baum committed Jul 16, 2024
1 parent b3aa883 commit 5d5201a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const pageTitle = (path: string) => {
if (config.preferHomeTilde) {
router.use((req, res, next) => {
if (req.method === 'GET' && req.path.startsWith(homedir())) {
res.redirect(req.path.replace(homedir(), '/~'));
res.redirect(req.baseUrl + req.path.replace(homedir(), '/~'));
} else {
next();
}
Expand Down

0 comments on commit 5d5201a

Please sign in to comment.