From 576a855a19f5e839e8d0ed2b9bbd0efbb8f5631a Mon Sep 17 00:00:00 2001 From: Cenk Alti Date: Mon, 13 Jan 2020 17:01:21 +0300 Subject: [PATCH] set key field in http announce request --- internal/tracker/httptracker/httptracker.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/tracker/httptracker/httptracker.go b/internal/tracker/httptracker/httptracker.go index 1e252c66..86f1ec27 100644 --- a/internal/tracker/httptracker/httptracker.go +++ b/internal/tracker/httptracker/httptracker.go @@ -3,6 +3,7 @@ package httptracker import ( "bytes" "context" + "encoding/hex" "fmt" "io" "io/ioutil" @@ -72,6 +73,7 @@ func (t *HTTPTracker) Announce(ctx context.Context, req tracker.AnnounceRequest) if t.trackerID != "" { q.Set("trackerid", t.trackerID) } + q.Set("key", hex.EncodeToString(req.Torrent.PeerID[16:20])) u.RawQuery = q.Encode() t.log.Debugf("making request to: %q", u.String())