diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-23 19:58:44 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-23 19:58:44 +0000 |
commit | 02253a796181cf958f858ec3a767de333e0fcab5 (patch) | |
tree | a662b00a371656ec396ab4ba2bbb717302fbb643 /test/net/http/test_http.rb | |
parent | 0f9b33c793f225c1b817d73e5c915050c429edc4 (diff) | |
download | ruby-02253a796181cf958f858ec3a767de333e0fcab5.tar.gz |
* lib/net/http/generic_request.rb (Net::HTTPGenericRequest):
set content-length to zero on empty post requests
by Gregory Ostermayr <gregory.ostermayr@gmail.com>
https://github.com/ruby/ruby/pull/201 fix GH-201
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/http/test_http.rb')
-rw-r--r-- | test/net/http/test_http.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index fef010ab67..996a453cf1 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -310,6 +310,7 @@ module TestNetHTTP_version_1_1_methods start {|http| _test_post__base http _test_post__file http + _test_post__no_data http } end @@ -332,6 +333,14 @@ module TestNetHTTP_version_1_1_methods assert_equal data, f.string end + def _test_post__no_data(http) + unless self.is_a?(TestNetHTTP_v1_2_chunked) + data = nil + res = http.post('/', data) + assert_not_equal '411', res.code + end + end + def test_s_post_form url = "http://#{config('host')}:#{config('port')}/" res = Net::HTTP.post_form( |