committee 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/committee/response_validator.rb +5 -1
- data/test/response_validator_test.rb +5 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4db940a56b1cd87d070a6d084aad49a6c3ea75d7
|
4
|
+
data.tar.gz: 7cec1cdb5da554e7cd9851c8edfaed73e3007d52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1593142fbaee0fe7ec0aa232ed517546a4ad5a612d92e7fc370791b164dab2e0529c378d6385a477adf4aa765c4f92249d58ce202bcb963b9e39cb2fb1801053
|
7
|
+
data.tar.gz: 7e83215c71913202b83d0304baebe3f742b8d74a8d22addef2361d947643bd86b3e838e2f745d4cc0ae62195a16cadb6b2541c9b7f863a048cf0df0de7ce0711
|
@@ -36,8 +36,12 @@ module Committee
|
|
36
36
|
|
37
37
|
private
|
38
38
|
|
39
|
+
def response_media_type(response)
|
40
|
+
response.content_type.to_s.split(";").first.to_s
|
41
|
+
end
|
42
|
+
|
39
43
|
def check_content_type!(response)
|
40
|
-
unless Rack::Mime.match?(response
|
44
|
+
unless Rack::Mime.match?(response_media_type(response), @link.enc_type)
|
41
45
|
raise Committee::InvalidResponse,
|
42
46
|
%{"Content-Type" response header must be set to "#{@link.enc_type}".}
|
43
47
|
end
|
@@ -21,6 +21,11 @@ describe Committee::ResponseValidator do
|
|
21
21
|
call
|
22
22
|
end
|
23
23
|
|
24
|
+
it "passes through a valid response with Content-Type options" do
|
25
|
+
@headers = { "Content-Type" => "application/json; charset=utf-8" }
|
26
|
+
call
|
27
|
+
end
|
28
|
+
|
24
29
|
it "passes through a valid list response" do
|
25
30
|
@data = [@data]
|
26
31
|
@link = @list_link
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: committee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandur
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-03-
|
12
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json_schema
|
@@ -161,8 +161,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
164
|
+
rubygems_version: 2.2.2
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: A collection of Rack middleware to support JSON Schema.
|
168
168
|
test_files: []
|
169
|
+
has_rdoc:
|