better code
Massimo Melina committed
Jan 23, 2026 at 00:49 UTC
f260dab164a426080168b46dcf7f90ff0a5c23fb
1 file changed
+2
-2
src/api.monitor.ts
+2
-2
@@ -2,7 +2,7 @@
2
3
import _ from 'lodash'
4
import { Connection, disconnect, getConnections } from './connections'
5
-import { apiAssertTypes, isLocalHost, shortenAgent, try_, wait, wantArray } from './misc'
5
+import { apiAssertTypes, isLocalHost, safeDecodeURIComponent, shortenAgent, wait, wantArray } from './misc'
6
import { ApiHandlers } from './apiMiddleware'
7
import Koa from 'koa'
8
import { totalGot, totalInSpeed, totalOutSpeed, totalSent } from './throttler'
@@ -76,7 +76,7 @@ export default {
76
: s.uploadPath ? { op: 'upload', path: decodeURIComponent(s.uploadPath) }
77
: {
78
op: !s.considerAsGui && (ctx.state.archive || ctx.state.vfsNode) ? 'download' : undefined,
79
- path: try_(() => decodeURIComponent(ctx.originalUrl), () => ctx.originalUrl),
79
+ path: safeDecodeURIComponent(ctx.originalUrl),
80
},
81
opProgress: _.isNumber(s.opProgress) ? _.round(s.opProgress, 3) : undefined,
82
opTotal: s.opTotal,