From 18d17cd6cb853bc1de1510f38a48c8d337f420b4 Mon Sep 17 00:00:00 2001 From: Matthew Keeler Date: Thu, 15 Feb 2024 11:12:22 -0500 Subject: [PATCH] feat: Enable gzip compression on polling requests --- contract-tests/service.rb | 1 + lib/ldclient-rb/requestor.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/contract-tests/service.rb b/contract-tests/service.rb index d3c520fa..a14221c2 100644 --- a/contract-tests/service.rb +++ b/contract-tests/service.rb @@ -36,6 +36,7 @@ 'migrations', 'event-sampling', 'context-comparison', + 'polling-gzip', ], }.to_json end diff --git a/lib/ldclient-rb/requestor.rb b/lib/ldclient-rb/requestor.rb index c58ec81a..d1542890 100644 --- a/lib/ldclient-rb/requestor.rb +++ b/lib/ldclient-rb/requestor.rb @@ -26,6 +26,8 @@ def initialize(sdk_key, config) @sdk_key = sdk_key @config = config @http_client = LaunchDarkly::Util.new_http_client(config.base_uri, config) + .use(:auto_inflate) + .headers("Accept-Encoding" => "gzip") @cache = @config.cache_store end