Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contract-tests/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'

gem 'launchdarkly-server-sdk', path: '..'

gem 'http', '~> 5.1'
gem 'http', '>= 5.1', '< 7.0'
gem 'json'
gem "puma", "~> 6.6"
gem "rackup", "~> 2.2"
Expand Down
4 changes: 2 additions & 2 deletions launchdarkly-server-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ Gem::Specification.new do |spec|

spec.add_runtime_dependency "benchmark", "~> 0.1", ">= 0.1.1"
spec.add_runtime_dependency "concurrent-ruby", "~> 1.1"
spec.add_runtime_dependency "ld-eventsource", "2.5.1"
spec.add_runtime_dependency "ld-eventsource", "2.6.0"
spec.add_runtime_dependency "observer", "~> 0.1.2"
spec.add_runtime_dependency "openssl", ">= 3.1.2", "< 5.0"
spec.add_runtime_dependency "semantic", "~> 1.6"
spec.add_runtime_dependency "zlib", "~> 3.1" unless RUBY_PLATFORM == "java"
# Please keep ld-eventsource dependency as an exact version so that bugfixes to
# that LD library are always associated with a new SDK version.

spec.add_runtime_dependency "http", ">= 4.4.0", "< 6.0.0"
spec.add_runtime_dependency "http", ">= 4.4.0", "< 7.0.0"
spec.add_runtime_dependency "json", "~> 2.3"
end
4 changes: 1 addition & 3 deletions lib/ldclient-rb/impl/data_source/requestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ def make_request(path)
unless cached.nil?
headers["If-None-Match"] = cached.etag
end
response = @http_client.request("GET", uri, {
headers: headers,
})
response = @http_client.request("GET", uri, headers: headers)
status = response.status.code
# must fully read body for persistent connections
body = response.to_s
Expand Down
5 changes: 1 addition & 4 deletions lib/ldclient-rb/impl/event_sender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ def send_event_data(event_data, description, is_diagnostic)
body = gzip.close.string
end

response = http_client.request("POST", uri, {
headers: headers,
body: body,
})
response = http_client.request("POST", uri, headers: headers, body: body)
rescue StandardError => exn
@logger.warn { "[LDClient] Error sending events: #{exn.inspect}." }
next
Expand Down
12 changes: 6 additions & 6 deletions lib/ldclient-rb/impl/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,22 @@ def self.add_payload_filter_key(uri, config)
def self.new_http_client(http_config)
http_client_options = {}
if http_config.socket_factory
http_client_options["socket_class"] = http_config.socket_factory
http_client_options[:socket_class] = http_config.socket_factory
end
proxy = URI.parse(http_config.base_uri).find_proxy
unless proxy.nil?
http_client_options["proxy"] = {
http_client_options[:proxy] = {
proxy_address: proxy.host,
proxy_port: proxy.port,
proxy_username: proxy.user,
proxy_password: proxy.password,
}
end
HTTP::Client.new(http_client_options)
.timeout({
HTTP::Client.new(**http_client_options)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we need to do the same guards we did for event source?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because none of the options are coming in from the customer. The only options provided here are the ones we hard code above.

.timeout(
read: http_config.read_timeout,
connect: http_config.connect_timeout,
})
connect: http_config.connect_timeout
)
.persistent(http_config.base_uri)
end

Expand Down
Loading