excon 0.1.3 → 0.1.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.
@@ -13,7 +13,7 @@ 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.1.3'
16
+ s.version = '0.1.4'
17
17
  s.date = '2010-06-29'
18
18
  s.rubyforge_project = 'excon'
19
19
 
@@ -16,7 +16,7 @@ require 'excon/response'
16
16
  module Excon
17
17
 
18
18
  unless const_defined?(:VERSION)
19
- VERSION = '0.1.3'
19
+ VERSION = '0.1.4'
20
20
  end
21
21
 
22
22
  CHUNK_SIZE = 1048576 # 1 megabyte
@@ -28,7 +28,14 @@ module Excon
28
28
  params[:headers] ||= @connection[:headers]
29
29
  params[:headers]['Host'] ||= params[:host] || @connection[:host]
30
30
  params[:body] ||= @connection[:body]
31
- params[:headers]['Content-Length'] = (params[:body] && params[:body].size) || 0
31
+ params[:headers]['Content-Length'] = case params[:body]
32
+ when File
33
+ File.size(params[:body].path)
34
+ when String
35
+ params[:body].length
36
+ else
37
+ 0
38
+ end
32
39
  for key, value in params[:headers]
33
40
  request << "#{key}: #{value}\r\n"
34
41
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)