Skip to content

Commit dc709f6

Browse files
author
Dan Richelson
committed
Better number handling when dealing with response codes.
1 parent fd1fa87 commit dc709f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ldclient-rb/events.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def post_flushed_events(events)
3434
req.options.timeout = @config.read_timeout
3535
req.options.open_timeout = @config.connect_timeout
3636
end
37-
if res.status / 100 != 2
37+
if res.status < 200 || res.status >= 300
3838
@config.logger.error("[LDClient] Unexpected status code while processing events: #{res.status}")
3939
end
4040
end

lib/ldclient-rb/requestor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def make_request(path)
4444
return nil
4545
end
4646

47-
if res.status / 100 != 2
47+
if res.status < 200 || res.status >= 300
4848
@config.logger.error("[LDClient] Unexpected status code #{res.status}")
4949
return nil
5050
end

0 commit comments

Comments
 (0)