From 473d9a696aea76c4f7d0be3ad74c6888ab2c70ea Mon Sep 17 00:00:00 2001 From: Olivier Sazos Date: Thu, 15 Jul 2021 15:11:41 +0200 Subject: [PATCH] Code Style --- adapters/adagio/adagio.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/adapters/adagio/adagio.go b/adapters/adagio/adagio.go index e068f7d5c7e..28034567b3c 100644 --- a/adapters/adagio/adagio.go +++ b/adapters/adagio/adagio.go @@ -54,10 +54,8 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, _ *adapters.ExtraRe // Note: Gzipping could be handled natively later: https://github.com/prebid/prebid-server/issues/1812 var bodyBuf bytes.Buffer gz := gzip.NewWriter(&bodyBuf) - _, err = gz.Write(json) - if err == nil { - err = gz.Close() - if err == nil { + if _, err = gz.Write(json); err == nil { + if err = gz.Close(); err == nil { json = bodyBuf.Bytes() headers.Add("Content-Encoding", "gzip") // /!\ Go already sets the `Accept-Encoding: gzip` header. Never add it manually, or Go won't decompress the response.