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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0335b8d3183a04e00f759c04b3d508aef5ea49e1
4
- data.tar.gz: 23c1cd52eb5c46fad6d750716d22f2dae387892f
3
+ metadata.gz: 5fc646054942041e916923658fe0a94a8e002698
4
+ data.tar.gz: b360fa200f9855a39dd0c6589a9d5cb10b262c09
5
5
  SHA512:
6
- metadata.gz: 8b27950b43786c4b35a6f79f91e508c13c5ab3351270aa39edb68813c998305637ac23ba4f0b22f018b995c3ee5001f317c9ba944f4ebcdcff96308e792880a7
7
- data.tar.gz: a58196766694556976ffeb7dc8945545cf415a9e1ad343bf7fb5169fb5fa63b98519224e4915436d24b42902fe0dad2f7c7997e87a8a6e6126385facc110b9ea
6
+ metadata.gz: 4df86dbe82b8e15c4286d50c7f40d40c67c300cc93c1219e0513248d59cee5cf3dc561060498dd4c489b8c9a6ae04c4db1bec79bcca53cb69f29d9b594163270
7
+ data.tar.gz: c13d6282d4417ae4ba468375e20ee3584eb5bf1fe61e85f3be0d8b193e286a6a17d05072285a54ad349c8f3c3e99ecd6fe987479d8f14e45c04f3a42539dbf55
@@ -14,9 +14,17 @@ module Kea
14
14
 
15
15
  def params
16
16
  if @running_via_kea
17
- request.params['params']
17
+ if env['kea.params'].present?
18
+ env['kea.params']['params']
19
+ else
20
+ request.params['params']
21
+ end
18
22
  else
19
- request.params
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
- request.body.rewind
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kea-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marius Andra