diff --git a/CHANGELOG.md b/CHANGELOG.md index 464a33f2..4bbad76f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,5 @@ # Changelog -### Unreleased -* Added support for `Accept-Encoding: gzip` in HTTP headers - ### 6.2.0 / 2024-09-24 * Added query support for folders * Added dependency on `ostruct` gem diff --git a/lib/nylas/handler/http_client.rb b/lib/nylas/handler/http_client.rb index dea66044..1ba3d8b7 100644 --- a/lib/nylas/handler/http_client.rb +++ b/lib/nylas/handler/http_client.rb @@ -108,8 +108,7 @@ def build_request( def default_headers @default_headers ||= { "X-Nylas-API-Wrapper" => "ruby", - "User-Agent" => "Nylas Ruby SDK #{Nylas::VERSION} - #{RUBY_VERSION}", - "Accept-Encoding" => "gzip" + "User-Agent" => "Nylas Ruby SDK #{Nylas::VERSION} - #{RUBY_VERSION}" } end diff --git a/spec/nylas/handler/http_client_spec.rb b/spec/nylas/handler/http_client_spec.rb index beee6d09..d5cef1e1 100644 --- a/spec/nylas/handler/http_client_spec.rb +++ b/spec/nylas/handler/http_client_spec.rb @@ -23,8 +23,7 @@ class TestHttpClient it "returns the default headers" do expect(http_client.send(:default_headers)).to eq( "User-Agent" => "Nylas Ruby SDK 1.0.0 - 5.0.0", - "X-Nylas-API-Wrapper" => "ruby", - "Accept-Encoding" => "gzip" + "X-Nylas-API-Wrapper" => "ruby" ) end end @@ -65,8 +64,7 @@ class TestHttpClient expect(request[:headers]).to eq( "User-Agent" => "Nylas Ruby SDK 1.0.0 - 5.0.0", "X-Nylas-API-Wrapper" => "ruby", - "Authorization" => "Bearer fake-key", - "Accept-Encoding" => "gzip" + "Authorization" => "Bearer fake-key" ) end @@ -86,8 +84,7 @@ class TestHttpClient "X-Nylas-API-Wrapper" => "ruby", "Authorization" => "Bearer fake-key", "X-Custom-Header" => "custom-value", - "X-Custom-Header-2" => "custom-value-2", - "Accept-Encoding" => "gzip" + "X-Custom-Header-2" => "custom-value-2" ) end @@ -101,8 +98,7 @@ class TestHttpClient expect(request[:headers]).to eq( "User-Agent" => "Nylas Ruby SDK 1.0.0 - 5.0.0", "X-Nylas-API-Wrapper" => "ruby", - "Authorization" => "Bearer fake-key", - "Accept-Encoding" => "gzip" + "Authorization" => "Bearer fake-key" ) expect(request[:timeout]).to eq(30) end @@ -118,8 +114,7 @@ class TestHttpClient expect(request[:headers]).to eq( "User-Agent" => "Nylas Ruby SDK 1.0.0 - 5.0.0", "X-Nylas-API-Wrapper" => "ruby", - "Authorization" => "Bearer fake-key", - "Accept-Encoding" => "gzip" + "Authorization" => "Bearer fake-key" ) end @@ -136,8 +131,7 @@ class TestHttpClient "User-Agent" => "Nylas Ruby SDK 1.0.0 - 5.0.0", "X-Nylas-API-Wrapper" => "ruby", "Authorization" => "Bearer fake-key", - "Content-type" => "application/json", - "Accept-Encoding" => "gzip" + "Content-type" => "application/json" ) end @@ -152,8 +146,7 @@ class TestHttpClient expect(request[:headers]).to eq( "User-Agent" => "Nylas Ruby SDK 1.0.0 - 5.0.0", "X-Nylas-API-Wrapper" => "ruby", - "Authorization" => "Bearer fake-key", - "Accept-Encoding" => "gzip" + "Authorization" => "Bearer fake-key" ) end end