Sha256: fa52c868c4754dee877b9d5d7fad9506a80597dfe2ebc4d257ab33b835b4121a

Contents?: true

Size: 975 Bytes

Versions: 1

Compression:

Stored size: 975 Bytes

Contents

# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

module Contrast
  module Config
    # Common Configuration settings. Those in this section pertain to the
    # exception handling in Ruby, allowing for the override of Response Code
    # and Message when Security Exceptions are raised.
    class ExceptionConfiguration < BaseConfiguration
      # @return [Integer] the HTTP status code override
      attr_accessor :override_status
      # @return [String] the message text override
      attr_accessor :override_message
      attr_writer :capture

      def initialize hsh = {}
        @capture = traverse_config(hsh, :capture)
        @override_status = traverse_config(hsh, :override_status)
        @override_message = traverse_config(hsh, :override_message)
      end

      # @return [Boolean, false]
      def capture
        !!@capture
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
contrast-agent-6.0.0 lib/contrast/config/exception_configuration.rb