apill 1.1.1 → 1.2.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc3893065627f21a38207df0f237ef67613d0fbe
|
4
|
+
data.tar.gz: 9246e5feaba682181c5ad90e6f694351eabdf044
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
19
|
+
header: raw_accept_header)
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
data/lib/apill/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: human_error
|