class Rack::URISanitizer

Constants

VERSION

Public Class Methods

new(app) click to toggle source
# File lib/rack/uri_sanitizer.rb, line 5
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack/uri_sanitizer.rb, line 9
def call(env)
  unless /\A(?:%[0-9a-fA-F]{2}|[^%])*\z/ =~ env['QUERY_STRING'].to_s
    env['QUERY_STRING'] = env['QUERY_STRING'].gsub(/%(?![0-9a-fA-F]{2})/, '%25')
  end

  @app.call(env)
end