Don't add padding if the query matches the block size

Fixes #446
This commit is contained in:
Frank Denis 2018-05-16 11:31:47 +02:00
parent 255423588c
commit 281c2fa7f4
1 changed files with 3 additions and 1 deletions

View File

@ -264,7 +264,9 @@ func (xTransport *XTransport) DoHQuery(useGet bool, url *url.URL, body []byte, t
encBody := base64.RawURLEncoding.EncodeToString(body) encBody := base64.RawURLEncoding.EncodeToString(body)
qs.Add("body", encBody) qs.Add("body", encBody)
qs.Add("dns", encBody) qs.Add("dns", encBody)
if padding != nil {
qs.Add("random_padding", *padding) qs.Add("random_padding", *padding)
}
url2 := *url url2 := *url
url2.RawQuery = qs.Encode() url2.RawQuery = qs.Encode()
return xTransport.Get(&url2, dataType, timeout) return xTransport.Get(&url2, dataType, timeout)