non_printable_sanitization 0.0.3 → 0.0.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3bb17f01ea9d8c04ab0285e1dd5d389e569c5a0
|
4
|
+
data.tar.gz: 384b85affb91c091900c75a2c59da64c36b691bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6dcb697b11d5cffb4e85b0abefc1b79273c8a030d816a51b26e0507ee4b24777ef395b20ed8c9ea7ee5104e7113f101144e2053723cf08413ec7a0aed88827a
|
7
|
+
data.tar.gz: 819c0863c0bdec13b2336abd5e4bf89f61599bfae4d2c0d71bdd97b7cb3b50ea38497ff7181382d3b5b48f5bbf4ff0d1e5a5d0cc53ff9d754cffe9c27f7e54d5
|
@@ -43,7 +43,7 @@ class NonPrintableSanitization
|
|
43
43
|
if input && input.size > 0
|
44
44
|
url_encoded = is_url_encoded?(env)
|
45
45
|
input = ::URI.decode(input) if url_encoded
|
46
|
-
input.gsub!(/[
|
46
|
+
input.gsub!(/[[:cntrl:]]/, "")
|
47
47
|
input = ::URI.encode(input) if url_encoded
|
48
48
|
env["rack.input"] = StringIO.new(input)
|
49
49
|
end
|
@@ -50,6 +50,15 @@ describe ::NonPrintableSanitization do
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
context "with URL encoded printable content" do
|
54
|
+
let(:post_data) { "derp+derp+derp" }
|
55
|
+
let(:content_type) { "application/x-www-form-urlencoded" }
|
56
|
+
|
57
|
+
it "leaves the printable" do
|
58
|
+
expect(app.request_body).to eq("derp+derp+derp")
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
53
62
|
context "when path is skipped" do
|
54
63
|
context "with text/plain content" do
|
55
64
|
let(:path) { "/skippable" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: non_printable_sanitization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|