curb 0.7.10 → 0.7.11

Sign up to get free protection for your applications and to get access to all the features.
data/ext/curb.h CHANGED
@@ -20,12 +20,12 @@
20
20
  #include "curb_macros.h"
21
21
 
22
22
  // These should be managed from the Rake 'release' task.
23
- #define CURB_VERSION "0.7.10"
24
- #define CURB_VER_NUM 710
23
+ #define CURB_VERSION "0.7.11"
24
+ #define CURB_VER_NUM 711
25
25
  #define CURB_VER_MAJ 0
26
26
  #define CURB_VER_MIN 7
27
27
  #define CURB_VER_MIC 1
28
- #define CURB_VER_PATCH 0
28
+ #define CURB_VER_PATCH 1
29
29
 
30
30
 
31
31
  // Maybe not yet defined in Ruby
data/ext/curb_easy.c CHANGED
@@ -848,7 +848,7 @@ static VALUE ruby_curl_easy_put_data_set(VALUE self, VALUE data) {
848
848
  size = rb_funcall(stat, rb_intern("size"), 0);
849
849
  curl_easy_setopt(curl, CURLOPT_INFILESIZE, FIX2LONG(size));
850
850
  }
851
- else if( rb_hash_aref(headers, rb_str_new2("Transfer-Encoding")) == Qnil ) {
851
+ else if( rb_hash_aref(headers, rb_str_new2("Content-Length")) == Qnil && rb_hash_aref(headers, rb_str_new2("Transfer-Encoding")) == Qnil ) {
852
852
  rb_hash_aset(headers, rb_str_new2("Transfer-Encoding"), rb_str_new2("chunked"));
853
853
  }
854
854
  }
@@ -853,6 +853,13 @@ class TestCurbCurlEasy < Test::Unit::TestCase
853
853
  assert_equal 'GET', curl.body_str
854
854
  end
855
855
 
856
+ def test_easy_can_put_with_content_length
857
+ curl = Curl::Easy.new(TestServlet.url)
858
+ curl.headers['Content-Length'] = "hello".size
859
+ curl.http_put("hello")
860
+ assert_match /^PUT/, curl.body_str
861
+ assert_match /hello$/, curl.body_str
862
+ end
856
863
 
857
864
  include TestServerMethods
858
865
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 10
10
- version: 0.7.10
9
+ - 11
10
+ version: 0.7.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ross Bamford
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-01-20 00:00:00 -05:00
19
+ date: 2011-02-23 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies: []
22
22