Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 5 files changed
  • 0 comments
  • 1 contributor
9  CHANGELOG.md
Source Rendered
... ...
@@ -1,6 +1,13 @@
1 1
 ## In git
2 2
 
3  
-[Full Changelog](http://github.com/myronmarston/vcr/compare/v1.10.2...master)
  3
+[Full Changelog](http://github.com/myronmarston/vcr/compare/v1.10.3...master)
  4
+
  5
+## 1.10.3 (July 21, 2011)
  6
+
  7
+[Full Changelog](http://github.com/myronmarston/vcr/compare/v1.10.2...v1.10.3)
  8
+
  9
+* Fix `:update_content_length_header` option so no error is raised if
  10
+  a response body is nil. Bug reported by [jg](https://github.com/jg).
4 11
 
5 12
 ## 1.10.2 (July 16, 2011)
6 13
 
2  README.md
Source Rendered
@@ -137,11 +137,13 @@ Thanks also to the following people who have contributed patches or helpful sugg
137 137
 * [Aaron Brethorst](http://github.com/aaronbrethorst)
138 138
 * [Bartosz Blimke](http://github.com/bblimke)
139 139
 * [Ben Hutton](http://github.com/benhutton)
  140
+* [Bradley Isotope](https://github.com/bradleyisotope)
140 141
 * [Eric Allam](http://github.com/rubymaverick)
141 142
 * [Justin Smestad](https://github.com/jsmestad)
142 143
 * [Karl Baum](https://github.com/kbaum)
143 144
 * [Nathaniel Bibler](https://github.com/nbibler)
144 145
 * [Oliver Searle-Barnes](https://github.com/opsb)
  146
+* [Wesley Beary](https://github.com/geemus)
145 147
 
146 148
 ## Copyright
147 149
 
2  lib/vcr/structs/response.rb
@@ -13,7 +13,7 @@ def self.from_net_http_response(response)
13 13
     end
14 14
 
15 15
     def update_content_length_header
16  
-      headers['content-length'] &&= [body.length.to_s]
  16
+      headers['content-length'] &&= [body ? body.length.to_s : '0']
17 17
     end
18 18
   end
19 19
 end
2  lib/vcr/version.rb
@@ -3,7 +3,7 @@ module VCR
3 3
 
4 4
   def version
5 5
     @version ||= begin
6  
-      string = '1.10.2'
  6
+      string = '1.10.3'
7 7
 
8 8
       def string.parts
9 9
         split('.').map { |p| p.to_i }
7  spec/vcr/structs/response_spec.rb
@@ -57,5 +57,12 @@ def instance(body, content_length = nil)
57 57
         inst.update_content_length_header
58 58
       }.to change { inst.headers['content-length'] }.from(['3']).to(['8'])
59 59
     end
  60
+
  61
+    it 'sets the content_length header to 0 if the response body is nil' do
  62
+      inst = instance(nil, '3')
  63
+      expect {
  64
+        inst.update_content_length_header
  65
+      }.to change { inst.headers['content-length'] }.from(['3']).to(['0'])
  66
+    end
60 67
   end
61 68
 end

No commit comments for this range

Something went wrong with that request. Please try again.