From dc709f6d980cf3e3af656ab9efd01c8df95c33c1 Mon Sep 17 00:00:00 2001 From: Dan Richelson Date: Fri, 10 Feb 2017 10:13:42 -0800 Subject: [PATCH 1/2] Better number handling when dealing with response codes. --- lib/ldclient-rb/events.rb | 2 +- lib/ldclient-rb/requestor.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ldclient-rb/events.rb b/lib/ldclient-rb/events.rb index 5eb8899f..b26f2722 100644 --- a/lib/ldclient-rb/events.rb +++ b/lib/ldclient-rb/events.rb @@ -34,7 +34,7 @@ def post_flushed_events(events) req.options.timeout = @config.read_timeout req.options.open_timeout = @config.connect_timeout end - if res.status / 100 != 2 + if res.status < 200 || res.status >= 300 @config.logger.error("[LDClient] Unexpected status code while processing events: #{res.status}") end end diff --git a/lib/ldclient-rb/requestor.rb b/lib/ldclient-rb/requestor.rb index 82d522cf..b43cf209 100644 --- a/lib/ldclient-rb/requestor.rb +++ b/lib/ldclient-rb/requestor.rb @@ -44,7 +44,7 @@ def make_request(path) return nil end - if res.status / 100 != 2 + if res.status < 200 || res.status >= 300 @config.logger.error("[LDClient] Unexpected status code #{res.status}") return nil end From 7845cad3f195bf7e7125fc9339d0086a9a86ac5a Mon Sep 17 00:00:00 2001 From: Dan Richelson Date: Fri, 10 Feb 2017 10:14:49 -0800 Subject: [PATCH 2/2] Better number handling when dealing with response codes. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c39efe19..e3f02bf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the LaunchDarkly Ruby SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org). +## [2.0.6] - 2017-02-10 +## Changed +- Improved handling of http status codes that may not be integers. + ## [2.0.5] - 2017-01-31 ## Changed - Improved error handling when connected to flag update stream.