server: rTorrent: remove [] from IPv6 address

This commit is contained in:
Jesse Chan
2021-02-02 19:46:45 +08:00
parent 8b57aa9be9
commit 4d51ce42f2
@@ -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=',