httpclient 2.3.3 → 2.3.4

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 = ''
950
+ buf = ''.force_encoding('BINARY')
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 = ''
973
+ buf = ''.force_encoding('BINARY')
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 = ''
1001
+ buf = ''.force_encoding('BINARY')
1002
1002
  timeout(@receive_timeout, ReceiveTimeoutError) do
1003
1003
  begin
1004
1004
  @socket.readpartial(@read_block_size, buf)
@@ -1,3 +1,3 @@
1
1
  class HTTPClient
2
- VERSION = '2.3.3'
2
+ VERSION = '2.3.4'
3
3
  end
@@ -951,6 +951,7 @@ EOS
951
951
 
952
952
  def test_chunked
953
953
  assert_equal('chunked', @client.get_content(serverurl + 'chunked', { 'msg' => 'chunked' }))
954
+ assert_equal('あいうえお', @client.get_content(serverurl + 'chunked', { 'msg' => 'あいうえお' }))
954
955
  end
955
956
 
956
957
  def test_chunked_empty
@@ -1074,13 +1075,6 @@ EOS
1074
1075
  assert_equal('hello', @client.post(serverurl + 'sleep', :sec => 2).content)
1075
1076
  end
1076
1077
 
1077
- def test_async_error
1078
- assert_raise( SocketError ) do
1079
- conn = @client.get_async("http://non-existing-host/")
1080
- conn.pop
1081
- end
1082
- end
1083
-
1084
1078
  def test_reset
1085
1079
  url = serverurl + 'servlet'
1086
1080
  assert_nothing_raised do
@@ -1672,6 +1666,7 @@ private
1672
1666
 
1673
1667
  def do_chunked(req, res)
1674
1668
  res.chunked = true
1669
+ res['content-type'] = 'text/plain; charset=UTF-8'
1675
1670
  piper, pipew = IO.pipe
1676
1671
  res.body = piper
1677
1672
  pipew << req.query['msg']
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.3
4
+ version: 2.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-24 00:00:00.000000000 Z
12
+ date: 2013-07-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: nahi@ruby-lang.org
@@ -19,61 +19,61 @@ extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - bin/httpclient
22
- - lib/httpclient/auth.rb
23
- - lib/httpclient/ssl_config.rb
24
- - lib/httpclient/http.rb
22
+ - lib/httpclient.rb
23
+ - lib/http-access2.rb
24
+ - lib/hexdump.rb
25
25
  - lib/httpclient/timeout.rb
26
+ - lib/httpclient/http.rb
27
+ - lib/httpclient/ssl_config.rb
28
+ - lib/httpclient/session.rb
26
29
  - lib/httpclient/version.rb
27
- - lib/httpclient/connection.rb
28
30
  - lib/httpclient/include_client.rb
29
- - lib/httpclient/session.rb
30
- - lib/httpclient/cacert.p7s
31
+ - lib/httpclient/connection.rb
31
32
  - lib/httpclient/cookie.rb
32
33
  - lib/httpclient/util.rb
34
+ - lib/httpclient/auth.rb
35
+ - lib/httpclient/cacert.p7s
33
36
  - lib/oauthclient.rb
34
- - lib/httpclient.rb
35
- - lib/http-access2.rb
36
37
  - lib/http-access2/http.rb
37
38
  - lib/http-access2/cookie.rb
38
- - lib/hexdump.rb
39
- - sample/auth.rb
40
- - sample/dav.rb
41
- - sample/stream.rb
42
- - sample/async.rb
43
- - sample/wcat.rb
44
- - sample/ssl/1000cert.pem
45
- - sample/ssl/1000key.pem
46
- - sample/ssl/ssl_client.rb
39
+ - sample/oauth_salesforce_10.rb
40
+ - sample/ssl/0cert.pem
47
41
  - sample/ssl/0key.pem
42
+ - sample/ssl/ssl_client.rb
43
+ - sample/ssl/1000cert.pem
48
44
  - sample/ssl/htdocs/index.html
49
- - sample/ssl/0cert.pem
50
45
  - sample/ssl/webrick_httpsd.rb
51
- - sample/oauth_salesforce_10.rb
46
+ - sample/ssl/1000key.pem
47
+ - sample/oauth_twitter.rb
52
48
  - sample/thread.rb
49
+ - sample/dav.rb
53
50
  - sample/oauth_friendfeed.rb
54
- - sample/oauth_twitter.rb
55
- - sample/cookie.rb
51
+ - sample/stream.rb
56
52
  - sample/howto.rb
57
53
  - sample/oauth_buzz.rb
58
- - test/client.cert
59
- - test/test_http-access2.rb
60
- - test/server.cert
61
- - test/htdigest
54
+ - sample/wcat.rb
55
+ - sample/async.rb
56
+ - sample/cookie.rb
57
+ - sample/auth.rb
62
58
  - test/test_ssl.rb
63
- - test/test_hexdump.rb
64
- - test/test_cookie.rb
65
- - test/runner.rb
66
- - test/htpasswd
67
- - test/test_auth.rb
59
+ - test/htdigest
60
+ - test/server.key
68
61
  - test/client.key
69
- - test/test_include_client.rb
70
- - test/helper.rb
62
+ - test/client.cert
63
+ - test/htpasswd
71
64
  - test/ca.cert
65
+ - test/test_cookie.rb
72
66
  - test/sslsvr.rb
73
- - test/subca.cert
67
+ - test/test_http-access2.rb
68
+ - test/runner.rb
69
+ - test/server.cert
74
70
  - test/ca-chain.cert
75
- - test/server.key
71
+ - test/test_auth.rb
76
72
  - test/test_httpclient.rb
73
+ - test/helper.rb
74
+ - test/test_hexdump.rb
75
+ - test/test_include_client.rb
76
+ - test/subca.cert
77
77
  - README.txt
78
78
  homepage: http://github.com/nahi/httpclient
79
79
  licenses: []
@@ -87,12 +87,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
87
  - - ! '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
+ segments:
91
+ - 0
92
+ hash: -133302149569090076
90
93
  required_rubygems_version: !ruby/object:Gem::Requirement
91
94
  none: false
92
95
  requirements:
93
96
  - - ! '>='
94
97
  - !ruby/object:Gem::Version
95
98
  version: '0'
99
+ segments:
100
+ - 0
101
+ hash: -133302149569090076
96
102
  requirements: []
97
103
  rubyforge_project:
98
104
  rubygems_version: 1.8.23
@@ -100,4 +106,3 @@ signing_key:
100
106
  specification_version: 3
101
107
  summary: gives something like the functionality of libwww-perl (LWP) in Ruby
102
108
  test_files: []
103
- has_rdoc: