non_printable_sanitization 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e788de9464ae1da90ea6bbd9450ff2f53ed01c5
4
- data.tar.gz: 4bd7f0057d26a3ad9096ea864cef9558d2ad6a16
3
+ metadata.gz: e3bb17f01ea9d8c04ab0285e1dd5d389e569c5a0
4
+ data.tar.gz: 384b85affb91c091900c75a2c59da64c36b691bd
5
5
  SHA512:
6
- metadata.gz: bcff60eb6beefb429e2329d9c7c073ac46530eeac737ed3feff345b8b76c07bd7f2a421f3d2f627e10f8d33110f26292546266ed66b2b98b275609153fbcfd01
7
- data.tar.gz: 76b355402a41efd0fa1d4d0e4cd84c78e392ac8cf81961aa67ae2df7b5f32bcb292b50ccf102b1ea260ace4fab3ab92516c6568318329b0c89084d126ba69e37
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!(/[^[:print:]]/, "")
46
+ input.gsub!(/[[:cntrl:]]/, "")
47
47
  input = ::URI.encode(input) if url_encoded
48
48
  env["rack.input"] = StringIO.new(input)
49
49
  end
@@ -1,3 +1,3 @@
1
1
  class NonPrintableSanitization
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  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.3
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-07 00:00:00.000000000 Z
11
+ date: 2014-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack