Sha256: ec87da3d74043ac3f3c864724e97802098ea1477e2da05138db0fca3d28993e8

Contents?: true

Size: 791 Bytes

Versions: 4

Compression:

Stored size: 791 Bytes

Contents

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

require 'contrast/agent/assess/rule/response/header_rule'
require 'contrast/utils/string_utils'

module Contrast
  module Agent
    module Assess
      module Rule
        module Response
          # These rules check the content of the HTTP Response to determine if the response contains the needed header
          class XContentType < HeaderRule
            def rule_id
              'xcontenttype-header-missing'
            end

            HEADER_KEYS = %w[X-Content-Type-Options].cs__freeze
            ACCEPTED_VALUES = [/^nosniff/i].cs__freeze
            DEFAULT_SAFE = false
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
contrast-agent-6.1.0 lib/contrast/agent/assess/rule/response/x_content_type_header_rule.rb
contrast-agent-6.0.0 lib/contrast/agent/assess/rule/response/x_content_type_header_rule.rb
contrast-agent-5.3.0 lib/contrast/agent/assess/rule/response/x_content_type_header_rule.rb
contrast-agent-5.2.0 lib/contrast/agent/assess/rule/response/x_content_type_header_rule.rb