From 281c2fa7f4860feed31843007614b7695fb605bd Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 16 May 2018 11:31:47 +0200 Subject: [PATCH] Don't add padding if the query matches the block size Fixes #446 --- dnscrypt-proxy/xtransport.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dnscrypt-proxy/xtransport.go b/dnscrypt-proxy/xtransport.go index eda95c59..8e966cdb 100644 --- a/dnscrypt-proxy/xtransport.go +++ b/dnscrypt-proxy/xtransport.go @@ -264,7 +264,9 @@ func (xTransport *XTransport) DoHQuery(useGet bool, url *url.URL, body []byte, t encBody := base64.RawURLEncoding.EncodeToString(body) qs.Add("body", encBody) qs.Add("dns", encBody) - qs.Add("random_padding", *padding) + if padding != nil { + qs.Add("random_padding", *padding) + } url2 := *url url2.RawQuery = qs.Encode() return xTransport.Get(&url2, dataType, timeout)