fix: fix decoding issue in attachment route

This commit is contained in:
purocean
2024-07-11 23:23:11 +08:00
parent 42a0dc87e3
commit 30e7c831af
+1 -1
View File
@@ -211,7 +211,7 @@ const attachment = async (ctx: any, next: any) => {
if (!repo || !path) {
const filePath = ctx.path.replace('/api/attachment', '')
const arr = filePath.split('/')
repo = arr[1]
repo = decodeURIComponent(arr[1] || '')
path = decodeURI(arr.slice(2).join('/'))
}