sham_rack 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 887447b8de1ec4acf1dec895fc3f51634cedc2d7
4
- data.tar.gz: ad8bbd8c761fc122986386bba9907fef7273762e
3
+ metadata.gz: 163ef7501110df3856e1d434af4af5e54cb3c0dd
4
+ data.tar.gz: e7a6fa2fdfee306e172fe82072acc4aa643fb046
5
5
  SHA512:
6
- metadata.gz: 4a4bfe421be365279abdb1a5436b04fa08de0c93ca0a524d57767a5fd1fd7f8236b03815f15578c94eb14812de73b93830f4c8d0aad05da2fa08dab2a5112ab8
7
- data.tar.gz: 56abd422fc06f9ce5eff13bef96b230883ec49c97ec33bff4bb5aa2847f545e6ac6864d04dce3b8884e911e2f7372aa29cd2d3373258b76df69995c6345d6652
6
+ metadata.gz: 3e04d04e52cb0e2c54ebb0f817e26d5203bda8cc1e001778835b1d2a54b4814ebc7e671e8544646fed44eb65e1f23184bc8663ed77b89de0b25e78b3f09a88b8
7
+ data.tar.gz: b49a2d92a6e9087e4748d43b425373738d625545d415a3c69ed0e7017f8205e9288e7a2b2360d193cd8d88727354f4ba553876b7e4d3da13352e96a706d67048
@@ -66,8 +66,14 @@ module ShamRack
66
66
  end
67
67
 
68
68
  def request_env(request, body)
69
- body ||= request.body || ""
70
- Rack::MockRequest.env_for(request.path, :method => request.method, :input => body.to_s)
69
+ body ||= request_body(request)
70
+ Rack::MockRequest.env_for(request.path, :method => request.method, :input => body)
71
+ end
72
+
73
+ def request_body(request)
74
+ return request.body unless request.body.nil?
75
+ return request.body_stream.read unless request.body_stream.nil?
76
+ ""
71
77
  end
72
78
 
73
79
  def build_response(rack_response)
@@ -1,3 +1,3 @@
1
1
  module ShamRack
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sham_rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-06 00:00:00.000000000 Z
11
+ date: 2017-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  version: '0'
65
65
  requirements: []
66
66
  rubyforge_project: shamrack
67
- rubygems_version: 2.6.8
67
+ rubygems_version: 2.6.12
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: Net::HTTP-to-Rack plumbing