rack-json_response_wrapper 0.1.2 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61c133c2d526f015d9f223b886de8e0f39e08417
4
- data.tar.gz: 108cfccb51f6368ccc3984a4e7a909392c71a49e
3
+ metadata.gz: 254b228437c95fa2e13d0615dd0664741a968c97
4
+ data.tar.gz: 2d09820124142dfb93d784548685da2085a9ea6e
5
5
  SHA512:
6
- metadata.gz: 5df23e99db9d44a09eb8701e3aae86788ac9f90492af844cc085d87ab6c487820efe4b0c3733afdae9289f7b23c5c0aa36e83c51dfd36834bd1efafe456bca7f
7
- data.tar.gz: b5d5dfbccfd8f49741aa6d94af061effee9440ddddf401d1975093d99c1d2353bd01fb017beefe0deac2a37c65f152938638b75ec17fd2e9601668d365b3824b
6
+ metadata.gz: 3297f7090468971f564b1f137aadb47cfc7c3de028cf52b3e439aaf3a71a7066ac2933faf9eb1688a44fdef59795403ab8759b2085ae1a5afdc1de60a296db36
7
+ data.tar.gz: c47adbb63b9f98dcd3a7cd0092e84adf90b7d500b294aea7141193c94c0b47871ddcd0161de0fe179453c663e932a3511af703dca030bdef6be06546f60f2869
@@ -19,11 +19,15 @@ module Rack
19
19
  def should_wrap?(env, response)
20
20
  response_header = response[1]
21
21
 
22
- is_json = response_header['Content-Type'].match(/application\/json/)
23
- wants_wrap = env.include?('HTTP_X_WRAP_RESPONSE') ||
24
- env.include?('X-WRAP-RESPONSE')
22
+ if response_header.include? 'Content-Type'
23
+ is_json = response_header['Content-Type'].match(/application\/json/)
24
+ wants_wrap = env.include?('HTTP_X_WRAP_RESPONSE') ||
25
+ env.include?('X-WRAP-RESPONSE')
25
26
 
26
- is_json && wants_wrap
27
+ is_json && wants_wrap
28
+ else
29
+ false
30
+ end
27
31
  end
28
32
 
29
33
  def wrap_response(response)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-json_response_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - g. nicholas d'andrea
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-10 00:00:00.000000000 Z
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec