From ae9d5bce18fa57034ee73f1e3a45108176f67648 Mon Sep 17 00:00:00 2001 From: Justin M <37273682+DigitalAlchemist@users.noreply.github.com> Date: Mon, 4 Jan 2021 22:54:07 +0000 Subject: [PATCH] Align webtorrent tracker to BEP-3 Adding "omitempty" to json marshalling, bringing the webtorrent tracker AnnounceRequest in line with BEP-3, which states omitting the the "event" field is acceptable. --- webtorrent/tracker_protocol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webtorrent/tracker_protocol.go b/webtorrent/tracker_protocol.go index 167044a6..a63fe5a6 100644 --- a/webtorrent/tracker_protocol.go +++ b/webtorrent/tracker_protocol.go @@ -12,7 +12,7 @@ type AnnounceRequest struct { Uploaded int64 `json:"uploaded"` Downloaded int64 `json:"downloaded"` Left int64 `json:"left"` - Event string `json:"event"` + Event string `json:"event,omitempty"` Action string `json:"action"` InfoHash string `json:"info_hash"` PeerID string `json:"peer_id"` -- 2.48.1