apill 1.1.1 → 1.2.0

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: 4978fd82cf24f21bcbedf34a5086842fd0c82f8a
4
- data.tar.gz: 45e18274d4ed90d8d7d377c2746eb0a858ff311d
3
+ metadata.gz: fc3893065627f21a38207df0f237ef67613d0fbe
4
+ data.tar.gz: 9246e5feaba682181c5ad90e6f694351eabdf044
5
5
  SHA512:
6
- metadata.gz: 687871c4ad8068fddd8317dc19845677ec74bba3b70700a2a2b1eace782738984944bc440ba864b9fc7eef27d237896856a5de433fdba7e9f94bc34d8d72db28
7
- data.tar.gz: c22b38830eeaab0fae13aa878258eb4acc7e913cd179a2174da2e09669ed12717f0bbfdac2c5a50730a107eb756833e258243efec5f88ddd1554aca5a7b46b48
6
+ metadata.gz: 053e326bc6fd650e546df55c939d50b8198de7d1589e66bd5dd0c755cc7ba7752e37cd792b6ff56f1730241a1da3efeeaa5f161d903140ab71081be0ec3b17ca
7
+ data.tar.gz: 7ec2d27fc0da846a8c538fea7570cb63b2ddacc29da26d2e0acf65ae64595b7b5e12d06c42a1a179264d3183e416b27e461c0f1ca06720d29a62911b7634bd2b
@@ -13,8 +13,10 @@ module GenericMatcher
13
13
  end
14
14
 
15
15
  def matches?(request)
16
+ raw_accept_header = request.headers['Accept'] || request.params['accept']
17
+
16
18
  self.accept_header = Apill::AcceptHeader.new(application: application,
17
- header: request.headers['Accept'])
19
+ header: raw_accept_header)
18
20
  end
19
21
  end
20
22
  end
data/lib/apill/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Apill
2
- VERSION = '1.1.1'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -14,6 +14,16 @@ describe AcceptHeaderMatcher do
14
14
  expect(matcher.matches?(request)).to be_truthy
15
15
  end
16
16
 
17
+ it 'matches if the subdomain is API and the accept header is passed in as a parameter' do
18
+ request = OpenStruct.new(headers: {},
19
+ params: { 'accept' => 'application/vnd.matrix+zion;version=1.0.0' },
20
+ subdomains: [ 'api' ])
21
+
22
+ matcher = AcceptHeaderMatcher.new(application: 'matrix')
23
+
24
+ expect(matcher.matches?(request)).to be_truthy
25
+ end
26
+
17
27
  it 'does not match if the subdomain is not API but the accept header is valid' do
18
28
  request = OpenStruct.new(headers: { 'Accept' => 'application/vnd.matrix+zion' },
19
29
  subdomains: [ 'not-api' ])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apill
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jfelchner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-23 00:00:00.000000000 Z
11
+ date: 2014-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: human_error