Retain query parameters from announce URL.

This commit is contained in:
Robert Kästel 2016-02-14 21:15:51 +01:00
parent b514434581
commit 82b7abb877
1 changed files with 3 additions and 1 deletions

View File

@ -57,7 +57,9 @@ func (r *httpResponse) UnmarshalPeers() (ret []Peer, err error) {
}
func (me *httpClient) Announce(ar *AnnounceRequest) (ret AnnounceResponse, err error) {
q := make(url.Values)
// retain query parameters from announce URL
q := me.url.Query()
q.Set("info_hash", string(ar.InfoHash[:]))
q.Set("peer_id", string(ar.PeerId[:]))
q.Set("port", fmt.Sprintf("%d", ar.Port))