diff --git a/lib/ldclient-rb/impl/diagnostic_events.rb b/lib/ldclient-rb/impl/diagnostic_events.rb index 4c61a905..13a55756 100644 --- a/lib/ldclient-rb/impl/diagnostic_events.rb +++ b/lib/ldclient-rb/impl/diagnostic_events.rb @@ -79,7 +79,7 @@ def self.make_config_data(config) streamingDisabled: !config.stream?, userKeysCapacity: config.user_keys_capacity, userKeysFlushIntervalMillis: self.seconds_to_millis(config.user_keys_flush_interval), - usingProxy: ENV.has_key?('http_proxy') || ENV.has_key?('https_proxy') || ENV.has_key?('HTTP_PROXY'), + usingProxy: ENV.has_key?('http_proxy') || ENV.has_key?('https_proxy') || ENV.has_key?('HTTP_PROXY') || ENV.has_key?('HTTPS_PROXY'), usingRelayDaemon: config.use_ldd?, } ret diff --git a/spec/diagnostic_events_spec.rb b/spec/diagnostic_events_spec.rb index 0c4ef058..7e1bce7f 100644 --- a/spec/diagnostic_events_spec.rb +++ b/spec/diagnostic_events_spec.rb @@ -79,13 +79,15 @@ def expected_default_config end end - it "detects proxy" do - begin - ENV["http_proxy"] = 'http://my-proxy' - event = default_acc.create_init_event(Config.new) - expect(event[:configuration][:usingProxy]).to be true - ensure - ENV["http_proxy"] = nil + ['http_proxy', 'https_proxy', 'HTTP_PROXY', 'HTTPS_PROXY'].each do |name| + it "detects proxy #{name}" do + begin + ENV[name] = 'http://my-proxy' + event = default_acc.create_init_event(Config.new) + expect(event[:configuration][:usingProxy]).to be true + ensure + ENV[name] = nil + end end end