fix: (regression 0.47.0) download-counter plugin prevented list-uploader to work
Massimo Melina committed
Aug 2, 2023 at 16:06 UTC
2d074e55037e4adbfa0be6c2897d31e244ecd854
1 file changed
+3
-2
plugins/vhosting/plugin.js
+3
-2
@@ -1,5 +1,5 @@
1
exports.description = "If you want to have different home folders, based on domain"
2
-exports.version = 3.11
2
+exports.version = 3.12
3
exports.apiRequired = 2 // 2 is for the config 'array'
4
5
exports.config = {
@@ -44,12 +44,13 @@ exports.init = api => {
44
let { root='' } = row
45
if (root.endsWith('/'))
46
root = root.slice(0, -1)
47
+ if (!root) return
48
if (!params)
49
ctx.path = root + ctx.path
50
else
51
for (const [k,v] of Object.entries(params))
52
if (k.startsWith('uri'))
52
- params[k] = root + v
53
+ params[k] = Array.isArray(v) ? v.map(x => root + x) : root + v
54
}
55
}
56
}