From 4d51ce42f20c53222bb145145e160fda06d63f07 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Tue, 2 Feb 2021 19:46:45 +0800 Subject: [PATCH] server: rTorrent: remove [] from IPv6 address --- .../rTorrent/constants/methodCallConfigs/torrentPeer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/services/rTorrent/constants/methodCallConfigs/torrentPeer.ts b/server/services/rTorrent/constants/methodCallConfigs/torrentPeer.ts index 3addee1b..da8bfb40 100644 --- a/server/services/rTorrent/constants/methodCallConfigs/torrentPeer.ts +++ b/server/services/rTorrent/constants/methodCallConfigs/torrentPeer.ts @@ -3,7 +3,10 @@ import {stringTransformer, booleanTransformer, numberTransformer} from '../../ut const torrentPeerMethodCallConfigs = { address: { methodCall: 'p.address=', - transformValue: stringTransformer, + transformValue: (value: unknown) => { + const address = value as string; + return address.startsWith('[') ? address.slice(1, -1) : address; + }, }, clientVersion: { methodCall: 'p.client_version=',