utf8-cleaner 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/lib/utf8-cleaner/middleware.rb +1 -1
- data/lib/utf8-cleaner/version.rb +1 -1
- data/spec/middleware_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 374bd095410578dc3d8cde50fee9d63fc4368c3a
|
4
|
+
data.tar.gz: 69dc3e51d0697d179ae0f2f6170cd7d6b7767087
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 798c9c14ddca0d1e77796a24f2a5adb268dfe9f0e55a4664fe05b1d218aa02bf64d185e6ccb84174bd4329abd2ea6a2f03009b3c0d3fddb8e9754238cf4fe686
|
7
|
+
data.tar.gz: c4553b88e53826bcf6b5f28019bb74b18b1f7cf6c6eb9db373144a9c355d56cb54021eb8a098c65a7d136605b52494dc099e8c2419a7526fd3b6ca83185d264e
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -40,7 +40,7 @@ module UTF8Cleaner
|
|
40
40
|
|
41
41
|
def sanitize_env_rack_input(env)
|
42
42
|
case env['CONTENT_TYPE']
|
43
|
-
when 'application/x-www-form-urlencoded'
|
43
|
+
when 'application/x-www-form-urlencoded','application/json'
|
44
44
|
cleaned_value = cleaned_string(env['rack.input'].read)
|
45
45
|
env['rack.input'] = StringIO.new(cleaned_value) if cleaned_value
|
46
46
|
env['rack.input'].rewind
|
data/lib/utf8-cleaner/version.rb
CHANGED
data/spec/middleware_spec.rb
CHANGED
@@ -56,6 +56,16 @@ module UTF8Cleaner
|
|
56
56
|
expect(new_env['rack.input'].read).to eq "foo=%FFbar%F8"
|
57
57
|
end
|
58
58
|
end
|
59
|
+
|
60
|
+
describe "when json data is POSTed" do
|
61
|
+
before do
|
62
|
+
env['CONTENT_TYPE'] = 'application/json'
|
63
|
+
end
|
64
|
+
it "removes removes invalid %-encoded UTF-8 sequences" do
|
65
|
+
env['rack.input'].rewind
|
66
|
+
expect(new_env['rack.input'].read).to eq('foo=bar')
|
67
|
+
end
|
68
|
+
end
|
59
69
|
end
|
60
70
|
|
61
71
|
describe "with a minimal env" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utf8-cleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leon Miller-Out
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|