Skip to content

Commit

Permalink
Merge pull request #498 from nylas/revert-497-TW-3519-sdk-add-accept-…
Browse files Browse the repository at this point in the history
…encoding-gzip-on-the-headers

Revert "Adding support for `Accept-Encoding: gzip` in HTTP headers"
  • Loading branch information
SubashPradhan authored Nov 1, 2024
2 parents 9c09c9c + 2ed0ef2 commit 03ec00b
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 03ec00b

Please sign in to comment.