From 1d7e6b0849389eb2d7fabb1147a0230fb13a10ad Mon Sep 17 00:00:00 2001 From: Andrei Tomashpolskiy Date: Mon, 7 Aug 2017 23:21:30 +0300 Subject: [PATCH] URL encode local IP address in HTTP tracker request --- .../src/main/java/bt/tracker/http/HttpTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bt-http-tracker-client/src/main/java/bt/tracker/http/HttpTracker.java b/bt-http-tracker-client/src/main/java/bt/tracker/http/HttpTracker.java index 2acb3c958f..6626818358 100644 --- a/bt-http-tracker-client/src/main/java/bt/tracker/http/HttpTracker.java +++ b/bt-http-tracker-client/src/main/java/bt/tracker/http/HttpTracker.java @@ -147,7 +147,7 @@ private String buildQuery(TrackerRequestType eventType, TrackerRequestBuilder re InetAddress inetAddress = peer.getInetAddress(); if (inetAddress != null) { buf.append("&ip="); - buf.append(inetAddress.getHostAddress()); + buf.append(urlEncode(inetAddress.getHostAddress().getBytes())); } buf.append("&port=");