Skip to content

Commit

Permalink
Revert "Adding support for Accept-Encoding: gzip in HTTP headers"
Browse files Browse the repository at this point in the history
  • Loading branch information
SubashPradhan authored Oct 30, 2024
1 parent 9c09c9c commit 2ed0ef2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions lib/nylas/handler/http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 7 additions & 14 deletions spec/nylas/handler/http_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 2ed0ef2

Please sign in to comment.