class Arachni::HTTP::Response::Scope

Determines the {Scope scope} status of {Response}s.

@author Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>

Public Class Methods

new( response ) click to toggle source

@param [Arachni::HTTP::Response] response

Calls superclass method Arachni::HTTP::Message::Scope::new
# File lib/arachni/http/response/scope.rb, line 27
def initialize( response )
    super response

    @response = response
end

Public Instance Methods

exclude_as_binary?() click to toggle source

@return [Bool]

`true` if {OptionGroups::Scope#exclude_binaries?} and not {Response#text?},
`false` otherwise.

@see OptionGroups::Scope#exclude_binaries

# File lib/arachni/http/response/scope.rb, line 50
def exclude_as_binary?
    options.exclude_binaries? && !@response.text?
end
exclude_content?() click to toggle source

@return [Bool]

`true` if {Message#body} matches an
{OptionGroups::Scope#exclude_content_patterns} pattern, `false` otherwise.

@see OptionGroups::Scope#exclude_content_patterns

# File lib/arachni/http/response/scope.rb, line 59
def exclude_content?
    !!options.exclude_content_patterns.find { |i| @response.body =~ i }
end
out?() click to toggle source

@note Also takes into account the {URI::Scope} of the {Message#url}.

@return [Bool]

`true` if the {Response} is out of {OptionGroups::Scope scope},
`false` otherwise.

@see exclude_content? @see exclude_as_binary?

Calls superclass method
# File lib/arachni/http/response/scope.rb, line 41
def out?
    super || exclude_as_binary? || exclude_content?
end