invalid_utf8_rejector 0.0.2 → 0.0.3
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 +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +11 -0
- data/invalid_utf8_rejector.gemspec +0 -2
- data/lib/invalid_utf8_rejector/version.rb +1 -1
- data/spec/middleware_spec.rb +5 -5
- metadata +4 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd8e5a3f37ae47f1c9592964dc98871c3888b2b1
|
4
|
+
data.tar.gz: 71ee0ed7a83a1669370dd18ad9771f4a499a83b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc99842f379cd0b72740a4fef675eabe051e8ae9aa5c41a969a4cf0fdbfb44bec18830d3a75d26ee9e5a26fc666997f6c4351cac9eabe63461e4f9666efedcb
|
7
|
+
data.tar.gz: 0b24bf1b7aa896521bf8f9d1b3e5f344e06840c90cf7e6dbc5a8c694dc9653b362e9d8fd496201b9c49aae6db171eb5cd7b09eb71fe3f097f54dea74ed13672f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -18,8 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "rack", "~> 1.0"
|
22
|
-
|
23
21
|
spec.add_development_dependency "bundler"
|
24
22
|
spec.add_development_dependency "rake"
|
25
23
|
spec.add_development_dependency "rack-test", "0.6.2"
|
data/spec/middleware_spec.rb
CHANGED
@@ -35,7 +35,7 @@ RSpec.describe InvalidUTF8Rejector::Middleware do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it "should reject invalid UTF-8 chars in the query_string without calling the app" do
|
38
|
-
# Set params to nil. Without this, it defaults to empty hash, and rack-test tries to merge this with
|
38
|
+
# Set params to nil. Without this, it defaults to empty hash, and rack-test tries to merge this with
|
39
39
|
# the given params which blows up with an invalid UTF-8 error before reaching our code
|
40
40
|
get "/foo?ba%a0r", nil
|
41
41
|
expect(last_response.status).to eq(400)
|
@@ -43,7 +43,7 @@ RSpec.describe InvalidUTF8Rejector::Middleware do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should reject malformed UTF-8 chars in the query_string without calling the app" do
|
46
|
-
# Set params to nil. Without this, it defaults to empty hash, and rack-test tries to merge this with
|
46
|
+
# Set params to nil. Without this, it defaults to empty hash, and rack-test tries to merge this with
|
47
47
|
# the given params which blows up with an invalid UTF-8 error before reaching our code
|
48
48
|
get "/foo?bar=br54ba%9CAQ%C4%FD%928owse", nil
|
49
49
|
expect(last_response.status).to eq(400)
|
@@ -53,13 +53,13 @@ RSpec.describe InvalidUTF8Rejector::Middleware do
|
|
53
53
|
|
54
54
|
describe "handling invalid % encoded requests" do
|
55
55
|
it "should reject invalid % encoding in the path without calling the app" do
|
56
|
-
status,
|
56
|
+
status, _, _ = raw_rack_get('/foo%+bar')
|
57
57
|
expect(status).to eq(400)
|
58
58
|
expect(@inner_app_called).to eq(false)
|
59
59
|
end
|
60
60
|
|
61
61
|
it "should reject invalid % encoding in the query_string without calling the app" do
|
62
|
-
status,
|
62
|
+
status, _, _ = raw_rack_get('/foo', 'bar%=baz')
|
63
63
|
expect(status).to eq(400)
|
64
64
|
expect(@inner_app_called).to eq(false)
|
65
65
|
end
|
@@ -75,6 +75,6 @@ RSpec.describe InvalidUTF8Rejector::Middleware do
|
|
75
75
|
'SERVER_NAME' => 'example.org',
|
76
76
|
'SERVER_PORT' => 80,
|
77
77
|
}
|
78
|
-
|
78
|
+
app.call(env)
|
79
79
|
end
|
80
80
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invalid_utf8_rejector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Tomlins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rack
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: bundler
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,6 +77,7 @@ files:
|
|
91
77
|
- ".gitignore"
|
92
78
|
- ".rspec"
|
93
79
|
- ".travis.yml"
|
80
|
+
- CHANGELOG.md
|
94
81
|
- Gemfile
|
95
82
|
- LICENCE.txt
|
96
83
|
- README.md
|
@@ -122,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
109
|
version: '0'
|
123
110
|
requirements: []
|
124
111
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.4.5.1
|
126
113
|
signing_key:
|
127
114
|
specification_version: 4
|
128
115
|
summary: rack middleware to reject invalid UTF8 in requests
|