kea-on-rails 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kea/controller.rb +10 -2
- data/lib/kea/router.rb +18 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fc646054942041e916923658fe0a94a8e002698
|
4
|
+
data.tar.gz: b360fa200f9855a39dd0c6589a9d5cb10b262c09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4df86dbe82b8e15c4286d50c7f40d40c67c300cc93c1219e0513248d59cee5cf3dc561060498dd4c489b8c9a6ae04c4db1bec79bcca53cb69f29d9b594163270
|
7
|
+
data.tar.gz: c13d6282d4417ae4ba468375e20ee3584eb5bf1fe61e85f3be0d8b193e286a6a17d05072285a54ad349c8f3c3e99ecd6fe987479d8f14e45c04f3a42539dbf55
|
data/lib/kea/controller.rb
CHANGED
@@ -14,9 +14,17 @@ module Kea
|
|
14
14
|
|
15
15
|
def params
|
16
16
|
if @running_via_kea
|
17
|
-
|
17
|
+
if env['kea.params'].present?
|
18
|
+
env['kea.params']['params']
|
19
|
+
else
|
20
|
+
request.params['params']
|
21
|
+
end
|
18
22
|
else
|
19
|
-
|
23
|
+
if env['kea.params'].present?
|
24
|
+
env['kea.params']
|
25
|
+
else
|
26
|
+
request.params
|
27
|
+
end
|
20
28
|
end
|
21
29
|
end
|
22
30
|
|
data/lib/kea/router.rb
CHANGED
@@ -12,9 +12,25 @@ module Kea
|
|
12
12
|
|
13
13
|
request = Rack::Request.new(env)
|
14
14
|
body = request.body.read
|
15
|
-
params = JSON.parse(body).deep_symbolize_keys
|
16
15
|
|
17
|
-
|
16
|
+
params = nil
|
17
|
+
|
18
|
+
if body.present?
|
19
|
+
params = JSON.parse(body).with_indifferent_access
|
20
|
+
request.body.rewind
|
21
|
+
else
|
22
|
+
# googlebot seems to have given us data in this format
|
23
|
+
if env['rack.request.form_vars'].present?
|
24
|
+
json_params = JSON.parse(env['rack.request.form_vars']) rescue nil
|
25
|
+
params = json_params.with_indifferent_access if json_params.present?
|
26
|
+
|
27
|
+
if params.blank? && env['rack.request.form_hash'].present?
|
28
|
+
params = env['rack.request.form_hash'].with_indifferent_access
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
@env['kea.params'] = params.with_indifferent_access
|
18
34
|
|
19
35
|
begin
|
20
36
|
@endpoint = params[:endpoint].classify.constantize
|