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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9aedb3bccc410a9dbc3c361146b7d60a6dcb3f85
4
- data.tar.gz: 1eadfab98ece0372a7133a1429df76bd3c77f11b
3
+ metadata.gz: 6ac4862a247a545f17b0c5838d564fa541c3a17d
4
+ data.tar.gz: dfa29382e51d4eacd43d05a14ed09dbc8fa13381
5
5
  SHA512:
6
- metadata.gz: b75b6b31b27846b6d4761c9ce83d3c9a5e99a4ffcdd8a36a4069fddf4aa0b1db85335651692c5ae759db639b47ea164822d928b71c5b912e3022610e9f5374ab
7
- data.tar.gz: 670473dc12fbaf3ea3f9f32cebd72804d67833432fd43fb01ae7fb778298e383eb813f64042fef6053f6c640a856f4e711ceb95743224c5f1364133333dd64cc
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.content_type && !empty_request?(request)
22
- unless Rack::Mime.match?(request.content_type, @link.enc_type)
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.3
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-13 00:00:00.000000000 Z
12
+ date: 2015-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_schema