jpmobile 4.2.4 → 4.2.5

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: c642e8e056bb3640414207b90b5f708bbbbb381b
4
- data.tar.gz: b81621cee3f51f931acb99fe373950eeb8a2f167
3
+ metadata.gz: 75c55dcda88eb9b688229ad95addf319f2f9c5bc
4
+ data.tar.gz: 2c7b30902e3cd5174f4c76c2beaa34f6aa26f91a
5
5
  SHA512:
6
- metadata.gz: 14337a48b6e5432ee5f4d2df98e1b3224722a9c72d70bbeb47f2b99c47b6e204ce551d9e5093ac42c83650a6a5c7c8e1d2965720e3245229db669c18d5b5cb37
7
- data.tar.gz: de4719aad80730b8817ba8d197a67861584c42192f025f7226a5ff88b78df14706fdaa806710aae6570da80a9e1d020f8c5093408a18dd182f8d71947eaed407
6
+ metadata.gz: 8786691f538410a72d3ba82d91e0ebd83d0a594932b6174543ed1395125645809fee135a8c0f9ebe650aa71095bb48fc69558f3e9371731762472ce828a312a7
7
+ data.tar.gz: 59d9d825bc60b73fdadc69b6a233fdf19ef80960f82a6d6a5f5d86cd72ef2c23bffa8ffcdb85fca4153d6f5e9979ef31d0247c8542cd45922e0fec57d7d67694
@@ -9,17 +9,17 @@ module Jpmobile
9
9
 
10
10
  def call(env)
11
11
  # 入力
12
- if @mobile = env['rack.jpmobile'] and @mobile.apply_params_filter?
12
+ if mobile = env['rack.jpmobile'] and mobile.apply_params_filter?
13
13
  # パラメータをkey, valueに分解
14
14
  # form_params
15
15
  unless env['REQUEST_METHOD'] == 'GET' || env['REQUEST_METHOD'] == 'HEAD'
16
16
  unless env['CONTENT_TYPE'] =~ /application\/json|application\/xml/
17
- env['rack.input'] = StringIO.new(parse_query(env['rack.input'].read))
17
+ env['rack.input'] = StringIO.new(parse_query(env['rack.input'].read, mobile))
18
18
  end
19
19
  end
20
20
 
21
21
  # query_params
22
- env['QUERY_STRING'] = parse_query(env['QUERY_STRING'])
22
+ env['QUERY_STRING'] = parse_query(env['QUERY_STRING'], mobile)
23
23
  end
24
24
 
25
25
  status, env, body = @app.call(env)
@@ -28,17 +28,17 @@ module Jpmobile
28
28
  end
29
29
 
30
30
  private
31
- def to_internal(str)
32
- ::Rack::Utils.escape(@mobile.to_internal(::Rack::Utils.unescape(str)))
31
+ def to_internal(str, mobile)
32
+ ::Rack::Utils.escape(mobile.to_internal(::Rack::Utils.unescape(str)))
33
33
  end
34
- def parse_query(str)
34
+ def parse_query(str, mobile)
35
35
  return nil unless str
36
36
 
37
37
  new_array = []
38
38
  str.split("&").each do |param_pair|
39
39
  k, v = param_pair.split("=")
40
- k = to_internal(k) if k
41
- v = to_internal(v) if v
40
+ k = to_internal(k, mobile) if k
41
+ v = to_internal(v, mobile) if v
42
42
  new_array << "#{k}=#{v}" if k
43
43
  end
44
44
 
@@ -1,3 +1,3 @@
1
1
  module Jpmobile
2
- VERSION = "4.2.4"
2
+ VERSION = "4.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jpmobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.4
4
+ version: 4.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shin-ichiro OGAWA