Skip to content

Commit

Permalink
Require Ruby 2.3.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot authored and whitequark committed Dec 26, 2023
1 parent e550dea commit 0249300
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions lib/rack/utf8_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ def sanitize_rack_input(env)
uri_encoded = URI_ENCODED_CONTENT_TYPES.any? {|type| content_type == type}

if env['rack.input']
content_length = if env['CONTENT_LENGTH']
env['CONTENT_LENGTH'].to_i
end
sanitized_input = sanitize_io(env['rack.input'], uri_encoded, content_length)
sanitized_input = sanitize_io(env['rack.input'], uri_encoded, env['CONTENT_LENGTH']&.to_i)

env['rack.input'] = sanitized_input
env['CONTENT_LENGTH'] &&= sanitized_input.size.to_s
Expand Down
2 changes: 1 addition & 1 deletion rack-utf8_sanitizer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]

gem.required_ruby_version = '>= 1.9.3'
gem.required_ruby_version = '>= 2.3'

gem.add_dependency "rack", '>= 1.0', '< 4.0'

Expand Down

0 comments on commit 0249300

Please sign in to comment.