Skip to content

Commit

Permalink
Merge 8a7cca9 into 6dafbca
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej committed Oct 4, 2018
2 parents 6dafbca + 8a7cca9 commit fa5bc9c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions conn.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package clickhouse

import (
"compress/gzip"
"context"
"database/sql"
"database/sql/driver"
Expand Down Expand Up @@ -213,15 +212,7 @@ func (c *conn) doRequest(ctx context.Context, req *http.Request) (io.ReadCloser,
return nil, err
}

respBody := resp.Body
if resp.Header.Get("Content-Encoding") == "gzip" {
respBody, err = gzip.NewReader(respBody)
if err != nil {
return nil, err
}
}

return respBody, nil
return resp.Body, nil
}

func (c *conn) buildRequest(query string, params []driver.Value, readonly bool) (*http.Request, error) {
Expand All @@ -246,9 +237,6 @@ func (c *conn) buildRequest(query string, params []driver.Value, readonly bool)
p, _ := c.user.Password()
req.SetBasicAuth(c.user.Username(), p)
}
if c.useGzipCompression {
req.Header.Set("Accept-Encoding", "gzip")
}

return req, err
}
Expand Down

0 comments on commit fa5bc9c

Please sign in to comment.