We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24ada9b commit ffc952cCopy full SHA for ffc952c
1 file changed
src/app.js
@@ -48,6 +48,23 @@ const rootRouter = Router()
48
rootRouter.use("/", auth())
49
rootRouter.use("/", wol())
50
51
+app.use((req, res, next) => {
52
+ const origRedirect = res.redirect.bind(res)
53
+ res.redirect = function redirectOverride(...args) {
54
+ let target = args.pop()
55
+
56
+ if (typeof target === "string" && target.startsWith("/")) {
57
+ args.push(env.ENV.basePath + target)
58
+ } else {
59
+ args.push(target)
60
+ }
61
62
+ return origRedirect(...args)
63
64
65
+ next()
66
+})
67
68
app.use(env.ENV.basePath, rootRouter)
69
70
app.use((err, req, res, next) => {
0 commit comments