Sha256: 83cd40fa64cff6a43efad099a37cf39beb51811d796b6fae58ce38c2ea4addbe

Contents?: true

Size: 409 Bytes

Versions: 3

Compression:

Stored size: 409 Bytes

Contents

module Rack
  module EncodingGuard
    class SanitizeStrategy < Strategy
      def process(env)
        Strategy::PROCESSIBLE_KEYS.each do |key|
          env[key] = env[key].to_s.encode(Encoding::UTF_8, Encoding::BINARY,
                                          invalid: :replace, undef: :replace,
                                          replace: '')
        end
        yield
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-encoding_guard-0.1.2 lib/rack/encoding_guard/sanitize_strategy.rb
rack-encoding_guard-0.1.1 lib/rack/encoding_guard/sanitize_strategy.rb
rack-encoding_guard-0.1.0 lib/rack/encoding_guard/sanitize_strategy.rb