committee 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/committee/request_validator.rb +2 -2
- data/test/request_validator_test.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ac4862a247a545f17b0c5838d564fa541c3a17d
|
4
|
+
data.tar.gz: dfa29382e51d4eacd43d05a14ed09dbc8fa13381
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bf123acebdcab88a882410be484dcf849ecd304807d3263916a23da0bdea43461d23fe1b8842c423bda9db8f8a98bdec012abe534708914ed847460372eb537
|
7
|
+
data.tar.gz: 6b631a8e6b1fd64d027b6da68e029f31d5d1725325b3440deb3b7ed5700c01d18dc2727f872fdca559b42d6c762913b996b120f0296a3290bda90e8a662f9b94
|
@@ -18,8 +18,8 @@ module Committee
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def check_content_type!(request, data)
|
21
|
-
if request.
|
22
|
-
unless Rack::Mime.match?(request.
|
21
|
+
if request.media_type && !empty_request?(request)
|
22
|
+
unless Rack::Mime.match?(request.media_type, @link.enc_type)
|
23
23
|
raise Committee::InvalidRequest,
|
24
24
|
%{"Content-Type" request header must be set to "#{@link.enc_type}".}
|
25
25
|
end
|
@@ -23,6 +23,18 @@ describe Committee::RequestValidator do
|
|
23
23
|
call(data)
|
24
24
|
end
|
25
25
|
|
26
|
+
it "passes through a valid request with Content-Type options" do
|
27
|
+
@request =
|
28
|
+
Rack::Request.new({
|
29
|
+
"CONTENT_TYPE" => "application/json; charset=utf-8",
|
30
|
+
"rack.input" => StringIO.new("{}"),
|
31
|
+
})
|
32
|
+
data = {
|
33
|
+
"name" => "heroku-api",
|
34
|
+
}
|
35
|
+
call(data)
|
36
|
+
end
|
37
|
+
|
26
38
|
it "detects an invalid request Content-Type" do
|
27
39
|
e = assert_raises(Committee::InvalidRequest) {
|
28
40
|
@request =
|
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.6.
|
4
|
+
version: 1.6.4
|
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-02-
|
12
|
+
date: 2015-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json_schema
|