httpclient 2.3.4 → 2.3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -947,7 +947,7 @@ class HTTPClient
947
947
  def read_body_length(&block)
948
948
  return nil if @content_length == 0
949
949
  while true
950
- buf = ''.force_encoding('BINARY')
950
+ buf = empty_bin_str
951
951
  maxbytes = @read_block_size
952
952
  maxbytes = @content_length if maxbytes > @content_length
953
953
  timeout(@receive_timeout, ReceiveTimeoutError) do
@@ -970,7 +970,7 @@ class HTTPClient
970
970
 
971
971
  RS = "\r\n"
972
972
  def read_body_chunked(&block)
973
- buf = ''.force_encoding('BINARY')
973
+ buf = empty_bin_str
974
974
  while true
975
975
  len = @socket.gets(RS)
976
976
  if len.nil? # EOF
@@ -998,7 +998,7 @@ class HTTPClient
998
998
  @readbuf = nil
999
999
  end
1000
1000
  while true
1001
- buf = ''.force_encoding('BINARY')
1001
+ buf = empty_bin_str
1002
1002
  timeout(@receive_timeout, ReceiveTimeoutError) do
1003
1003
  begin
1004
1004
  @socket.readpartial(@read_block_size, buf)
@@ -1013,6 +1013,12 @@ class HTTPClient
1013
1013
  end
1014
1014
  end
1015
1015
  end
1016
+
1017
+ def empty_bin_str
1018
+ str = ''
1019
+ str.force_encoding('BINARY') if str.respond_to?(:force_encoding)
1020
+ str
1021
+ end
1016
1022
  end
1017
1023
 
1018
1024
 
@@ -1,3 +1,3 @@
1
1
  class HTTPClient
2
- VERSION = '2.3.4'
2
+ VERSION = '2.3.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.4
4
+ version: 2.3.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -89,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  segments:
91
91
  - 0
92
- hash: -133302149569090076
92
+ hash: -1409690202161290935
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  segments:
100
100
  - 0
101
- hash: -133302149569090076
101
+ hash: -1409690202161290935
102
102
  requirements: []
103
103
  rubyforge_project:
104
104
  rubygems_version: 1.8.23