ftw 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -54,12 +54,16 @@ module FTW::HTTP::Message
54
54
  # TODO(sissel): if it's an IO object, set Transfer-Encoding to chunked
55
55
  # TODO(sissel): if it responds to each or appears to be Enumerable, then
56
56
  # set Transfer-Encoding to chunked.
57
- if message_body.respond_to?(:read) or message_body.respond_to?(:each)
57
+ @body = message_body
58
+
59
+ # don't set any additional length/encoding headers if they are already set.
60
+ return if headers.include?("Content-Length") or headers.include?("Transfer-Encoding")
61
+
62
+ if (message_body.respond_to?(:read) or message_body.respond_to?(:each)) and
58
63
  headers["Transfer-Encoding"] = "chunked"
59
64
  else
60
65
  headers["Content-Length"] = message_body.length
61
66
  end
62
- @body = message_body
63
67
  end # def body=
64
68
 
65
69
  # Get the body of this message
data/lib/ftw/version.rb CHANGED
@@ -3,5 +3,5 @@ require "ftw/namespace"
3
3
  # :nodoc:
4
4
  module FTW
5
5
  # The version of this library
6
- VERSION = "0.0.18"
6
+ VERSION = "0.0.19"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-24 00:00:00.000000000 Z
12
+ date: 2012-06-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 1.8.21
176
+ rubygems_version: 1.8.24
177
177
  signing_key:
178
178
  specification_version: 3
179
179
  summary: For The Web. Trying to build a solid and sane API for client and server web