patron 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 4
4
- :patch: 5
4
+ :patch: 6
5
5
  :build:
@@ -356,7 +356,7 @@ static VALUE perform_request(VALUE self) {
356
356
  rb_funcall(response, rb_intern("parse_headers"), 1, header_buffer);
357
357
  return response;
358
358
  } else {
359
- rb_raise(select_error(ret), state->error_buf);
359
+ rb_raise(select_error(ret), "%s", state->error_buf);
360
360
  }
361
361
  }
362
362
 
@@ -48,11 +48,14 @@ module Patron
48
48
  @status_line = header.strip
49
49
  else
50
50
  parts = header.split(':', 2)
51
- parts[1].strip! unless parts[1].nil?
52
- if @headers.has_key?(parts[0])
53
- @headers[parts[0]] << ",#{parts[1]}"
54
- else
55
- @headers[parts[0]] = parts[1]
51
+ unless parts.empty?
52
+ parts[1].strip! unless parts[1].nil?
53
+ if @headers.has_key?(parts[0])
54
+ @headers[parts[0]] = [@headers[parts[0]]] unless @headers[parts[0]].kind_of? Array
55
+ @headers[parts[0]] << parts[1]
56
+ else
57
+ @headers[parts[0]] = parts[1]
58
+ end
56
59
  end
57
60
  end
58
61
  end
@@ -159,6 +159,9 @@ module Patron
159
159
 
160
160
  # Send an HTTP request to the specified +url+.
161
161
  def request(action, url, headers, options = {})
162
+ # If the Expect header isn't set uploads are really slow
163
+ headers['Expect'] ||= ''
164
+
162
165
  req = Request.new
163
166
  req.action = action
164
167
  req.timeout = self.timeout
@@ -38,8 +38,8 @@ describe Patron::Response do
38
38
  response.headers['Content-Length'].should match(/^\d+$/)
39
39
  end
40
40
 
41
- it "should combine header values sent in different fields with same name" do
41
+ it "should return an array of values when multiple header fields have same name" do
42
42
  response = @session.get("/repetitiveheader")
43
- response.headers['Set-Cookie'].should == "a=1,b=2"
43
+ response.headers['Set-Cookie'].should == ["a=1","b=2"]
44
44
  end
45
45
  end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 4
8
+ - 6
9
+ version: 0.4.6
5
10
  platform: ruby
6
11
  authors:
7
12
  - Phillip Toland
@@ -9,7 +14,7 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-01-28 00:00:00 -06:00
17
+ date: 2010-03-21 00:00:00 -05:00
13
18
  default_executable:
14
19
  dependencies: []
15
20
 
@@ -63,18 +68,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
68
  requirements:
64
69
  - - ">="
65
70
  - !ruby/object:Gem::Version
71
+ segments:
72
+ - 0
66
73
  version: "0"
67
- version:
68
74
  required_rubygems_version: !ruby/object:Gem::Requirement
69
75
  requirements:
70
76
  - - ">="
71
77
  - !ruby/object:Gem::Version
78
+ segments:
79
+ - 0
72
80
  version: "0"
73
- version:
74
81
  requirements: []
75
82
 
76
83
  rubyforge_project: patron
77
- rubygems_version: 1.3.5
84
+ rubygems_version: 1.3.6
78
85
  signing_key:
79
86
  specification_version: 3
80
87
  summary: Patron HTTP client