webmock 1.17.2 → 1.17.3

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.
@@ -3,13 +3,15 @@ rvm:
3
3
  - 1.9.2
4
4
  - 1.9.3
5
5
  - 2.0.0
6
+ - 2.1.0
7
+ - ruby-head
6
8
  - ree
7
- - jruby-19mode
8
9
  - jruby-18mode
9
- - rbx-18mode
10
- - rbx-19mode
10
+ - jruby-19mode
11
+ - jruby
12
+ - jruby-head
11
13
  matrix:
12
14
  allow_failures:
13
- - rvm: rbx-18mode
14
- - rvm: rbx-19mode
15
15
  - rvm: jruby-18mode
16
+ - rvm: jruby-head
17
+ - rvm: ruby-head
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.17.3
4
+
5
+ * Fixed issue with Rack response removing 'Content-Type' header
6
+
7
+ Thanks to [Bo Jeanes](https://github.com/bjeanes) and [Matthew Conway](https://github.com/mattonrails)
8
+
3
9
  ## 1.17.2
4
10
 
5
11
  * Support for chunked responses in Curb
data/README.md CHANGED
@@ -879,6 +879,8 @@ People who submitted patches and new features or suggested improvements. Many th
879
879
  * Jon Rowe
880
880
  * Aleksey V. Zapparov
881
881
  * Praveen Arimbrathodiyil
882
+ * Bo Jeanes
883
+ * Matthew Conway
882
884
 
883
885
  For a full list of contributors you can visit the
884
886
  [contributors](https://github.com/bblimke/webmock/contributors) page.
@@ -25,7 +25,7 @@ module WebMock
25
25
 
26
26
  def build_rack_env(request)
27
27
  uri = request.uri
28
- headers = request.headers || {}
28
+ headers = (request.headers || {}).dup
29
29
  body = request.body || ''
30
30
 
31
31
  env = {
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '1.17.2' unless defined?(::WebMock::VERSION)
2
+ VERSION = '1.17.3' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -255,6 +255,19 @@ shared_context "declared responses" do |*adapter_info|
255
255
  stub_request(:get, "http://www.example.com/compute").to_rack(MyRackApp)
256
256
  http_request(:get, "http://www.example.com/compute").status.should == "200"
257
257
  end
258
+
259
+ it "preserves content-type header when proxying to a rack app" do
260
+ stub_request(:any, //).to_rack(lambda {|req| [200, {}, ["OK"]] })
261
+
262
+ url = "https://google.com/hi/there"
263
+ headers = {
264
+ "Accept" => "application/json",
265
+ "Content-Type" => "application/json"
266
+ }
267
+
268
+ http_request(:get, url, :headers => headers)
269
+ WebMock.should have_requested(:get, url).with(:headers => headers)
270
+ end
258
271
  end
259
272
 
260
273
  describe "when sequences of responses are declared" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
3
  version: !ruby/object:Gem::Version
4
- hash: 87
4
+ hash: 85
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 17
9
- - 2
10
- version: 1.17.2
9
+ - 3
10
+ version: 1.17.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bartosz Blimke
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-02-02 00:00:00 +01:00
18
+ date: 2014-02-12 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency