Skip to content

Commit f9ddf9a

Browse files
authored
Merge pull request #554 from splitio/rbs-fix-proxy
Fix proxy error
2 parents 1ba8c0b + a35a61c commit f9ddf9a

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

lib/splitclient-rb.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
require 'splitclient-rb/engine/models/label'
108108
require 'splitclient-rb/engine/models/segment_type'
109109
require 'splitclient-rb/engine/models/treatment'
110+
require 'splitclient-rb/engine/models/split_http_response'
110111
require 'splitclient-rb/engine/auth_api_client'
111112
require 'splitclient-rb/engine/back_off'
112113
require 'splitclient-rb/engine/push_manager'

lib/splitclient-rb/engine/api/client.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ def get_api(url, api_key, params = {}, cache_control_headers = false)
2020

2121
@config.split_logger.log_if_debug("GET #{url} proxy: #{api_client.proxy}")
2222
end
23+
24+
rescue Zlib::GzipFile::Error => e
25+
@config.logger.warn("Incorrect formatted response exception: #{e}\n")
26+
SplitIoClient::Engine::Models::SplitHttpResponse.new(400, '', true)
27+
2328
rescue StandardError => e
2429
@config.logger.warn("#{e}\nURL:#{url}\nparams:#{params}")
2530
raise e, 'Split SDK failed to connect to backend to retrieve information', e.backtrace
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module SplitIoClient
2+
module Engine
3+
module Models
4+
class SplitHttpResponse
5+
attr_accessor :status, :body
6+
7+
def initialize(status, body, success)
8+
@status = status
9+
@body = body
10+
@success = success
11+
end
12+
13+
def success?
14+
@success
15+
end
16+
end
17+
end
18+
end
19+
end

lib/splitclient-rb/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module SplitIoClient
2-
VERSION = '8.5.0'
2+
VERSION = '8.6.0-rc1'
33
end

0 commit comments

Comments
 (0)