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 +4 -4
- data/lib/jpmobile/rack/params_filter.rb +8 -8
- data/lib/jpmobile/version.rb +1 -1
- 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: 75c55dcda88eb9b688229ad95addf319f2f9c5bc
|
4
|
+
data.tar.gz: 2c7b30902e3cd5174f4c76c2beaa34f6aa26f91a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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(
|
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
|
|
data/lib/jpmobile/version.rb
CHANGED