Sha256: b2dad90f8d1adbf05d9040b7422c624c9c7d7287d6d3931d96f4f1d04be8c3b1

Contents?: true

Size: 788 Bytes

Versions: 20

Compression:

Stored size: 788 Bytes

Contents

module Honeybadger
  module Util
    class RequestSanitizer

      def initialize(sanitizer)
        @sanitizer = sanitizer
      end

      def sanitize(request_hash)
        request_hash.merge({
          url: sanitize_url(request_hash[:url]),
          component: request_hash[:component],
          action: request_hash[:action],
          params: sanitize_hash(request_hash[:params]),
          session: sanitize_hash(request_hash[:session]),
          cgi_data: sanitize_hash(request_hash[:cgi_data])
        })
      end

      private

      def sanitize_url(url)
        if url
          @sanitizer.filter_url(url)
        end
      end

      def sanitize_hash(hash)
        if hash
          @sanitizer.filter(@sanitizer.sanitize(hash))
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
honeybadger-2.0.6 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.5 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.4 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.3 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.2 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.1 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.13 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.12 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.11 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.10 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.9 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.8 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.7 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.6 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.5 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.4 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.3 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.2 lib/honeybadger/util/request_sanitizer.rb
honeybadger-2.0.0.beta.1 lib/honeybadger/util/request_sanitizer.rb