diff --git a/Makefile b/Makefile index ba03e1ee..e1f2ed7e 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ install-contract-tests-deps: poetry install --with contract-tests .PHONY: start-contract-test-service -start-contract-test-service: +start-contract-test-service: install-contract-tests-deps @cd contract-tests && poetry run python service.py $(PORT) .PHONY: start-contract-test-service-bg @@ -69,4 +69,4 @@ run-contract-tests: .PHONY: contract-tests contract-tests: #! Run the contract test harness -contract-tests: install-contract-tests-deps start-contract-test-service-bg run-contract-tests +contract-tests: start-contract-test-service-bg run-contract-tests diff --git a/ldclient/impl/datasource/feature_requester.py b/ldclient/impl/datasource/feature_requester.py index 98d07bb8..b5f390bc 100644 --- a/ldclient/impl/datasource/feature_requester.py +++ b/ldclient/impl/datasource/feature_requester.py @@ -29,6 +29,7 @@ def get_all_data(self): uri = self._poll_uri hdrs = _headers(self._config) cache_entry = self._cache.get(uri) + hdrs['Accept-Encoding'] = 'gzip' if cache_entry is not None: hdrs['If-None-Match'] = cache_entry.etag r = self._http.request('GET', uri, diff --git a/ldclient/impl/http.py b/ldclient/impl/http.py index 9ebb0102..5fea123d 100644 --- a/ldclient/impl/http.py +++ b/ldclient/impl/http.py @@ -19,8 +19,7 @@ def _application_header_value(application: dict) -> str: def _base_headers(config): headers = {'Authorization': config.sdk_key or '', - 'User-Agent': 'PythonClient/' + VERSION, - 'Accept-Encoding': 'gzip' + 'User-Agent': 'PythonClient/' + VERSION } app_value = _application_header_value(config.application) diff --git a/testing/impl/datasource/test_streaming.py b/testing/impl/datasource/test_streaming.py index eb90173a..a3cfe60f 100644 --- a/testing/impl/datasource/test_streaming.py +++ b/testing/impl/datasource/test_streaming.py @@ -43,7 +43,6 @@ def test_request_properties(): assert req.method == 'GET' assert req.headers.get('Authorization') == 'sdk-key' assert req.headers.get('User-Agent') == 'PythonClient/' + VERSION - assert req.headers['Accept-Encoding'] == 'gzip' assert req.headers.get('X-LaunchDarkly-Wrapper') is None assert req.headers.get('X-LaunchDarkly-Tags') is None diff --git a/testing/impl/events/test_event_processor.py b/testing/impl/events/test_event_processor.py index 51d8b0e4..b2bf91de 100644 --- a/testing/impl/events/test_event_processor.py +++ b/testing/impl/events/test_event_processor.py @@ -479,14 +479,6 @@ def test_sdk_key_is_sent(): assert mock_http.request_headers.get('Authorization') == 'SDK_KEY' -def test_default_headers_are_send(): - with DefaultTestProcessor() as ep: - ep.send_event(EventInputIdentify(timestamp, context)) - ep.flush() - ep._wait_until_inactive() - - assert mock_http.request_headers.get('Accept-Encoding') == 'gzip' - def test_wrapper_header_not_sent_when_not_set(): with DefaultTestProcessor() as ep: ep.send_event(EventInputIdentify(timestamp, context))