excon 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of excon might be problematic. Click here for more details.

@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'excon'
16
- s.version = '0.2.1'
17
- s.date = '2010-09-08'
16
+ s.version = '0.2.2'
17
+ s.date = '2010-09-16'
18
18
  s.rubyforge_project = 'excon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -16,7 +16,7 @@ require 'excon/response'
16
16
  module Excon
17
17
 
18
18
  unless const_defined?(:VERSION)
19
- VERSION = '0.2.1'
19
+ VERSION = '0.2.2'
20
20
  end
21
21
 
22
22
  CHUNK_SIZE = 1048576 # 1 megabyte
@@ -19,7 +19,7 @@ module Excon
19
19
  unless params[:path][0..0] == '/'
20
20
  params[:path] = "/#{params[:path]}"
21
21
  end
22
- request = "#{params[:method]} #{params[:path]}?"
22
+ request = "#{params[:method].upcase} #{params[:path]}?"
23
23
  for key, values in (params[:query] || @connection[:query] || {})
24
24
  for value in [*values]
25
25
  request << "#{key}#{value && "=#{CGI.escape(value.to_s)}"}&"
@@ -26,7 +26,7 @@ module Excon
26
26
  block = lambda { |chunk| response.body << chunk }
27
27
  end
28
28
 
29
- if response.headers['Transfer-Encoding'] == 'chunked'
29
+ if response.headers['Transfer-Encoding'] && response.headers['Transfer-Encoding'].downcase == 'chunked'
30
30
  while true
31
31
  chunk_size = socket.readline.chop!.to_i(16)
32
32
  chunk = socket.read(chunk_size + 2).chop! # 2 == "/r/n".length
@@ -36,7 +36,7 @@ module Excon
36
36
  break
37
37
  end
38
38
  end
39
- elsif response.headers['Connection'] == 'close'
39
+ elsif response.headers['Connection'] && response.headers['Connection'].downcase == 'close'
40
40
  block.call(socket.read)
41
41
  elsif response.headers['Content-Length']
42
42
  remaining = response.headers['Content-Length'].to_i
@@ -10,5 +10,6 @@ def with_rackup(configru = local_file('config.ru'))
10
10
  pid, w, r, e = Open4.popen4("rackup #{configru}")
11
11
  while `lsof -p #{pid} -P -i | grep ruby | grep TCP`.chomp.empty?; end
12
12
  yield
13
+ ensure
13
14
  Process.kill(9, pid)
14
15
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-08 00:00:00 -07:00
17
+ date: 2010-09-16 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies: []
20
20