lib/spark_api/connection.rb in spark_api-1.3.3 vs lib/spark_api/connection.rb in spark_api-1.3.6

- old
+ new

@@ -16,9 +16,13 @@ opts[:url] = @endpoint.sub /^http:/, "https:" else opts[:url] = @endpoint.sub /^https:/, "http:" end + if self.compress + opts[:headers]["Accept-Encoding"] = 'gzip, deflate' + end + conn = Faraday.new(opts) do |conn| conn.response :spark_api conn.adapter Faraday.default_adapter end SparkApi.logger.debug("Connection: #{conn.inspect}")