Class: Rack::Sanitize
- Inherits:
-
Object
- Object
- Rack::Sanitize
- Defined in:
- lib/rack/sanitize.rb,
lib/rack-sanitize/version.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, config = {}) ⇒ Sanitize
constructor
A new instance of Sanitize.
Constructor Details
#initialize(app, config = {}) ⇒ Sanitize
Returns a new instance of Sanitize.
5 6 7 8 |
# File 'lib/rack/sanitize.rb', line 5 def initialize(app, config={}) @app = app @config = config end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/rack/sanitize.rb', line 10 def call(env) request = Rack::Request.new(env) request.GET.each {|k,v| request.GET[k] = sanitize(v)} request.POST.each {|k,v| request.POST[k] = sanitize(v)} @app.call(env) end |