Class: Arachni::HTTP::Response::Scope
- Inherits:
 - 
      Message::Scope
      
        
- Object
 - Scope
 - URI::Scope
 - Message::Scope
 - Arachni::HTTP::Response::Scope
 
 
- Defined in:
 - lib/arachni/http/response/scope.rb
 
Overview
Determines the scope status of Arachni::HTTP::Responses.
Direct Known Subclasses
Defined Under Namespace
Classes: Error
Instance Method Summary collapse
- 
  
    
      #exclude_as_binary?  ⇒ Bool 
    
    
  
  
  
  
  
  
  
  
  
    
`true` if OptionGroups::Scope#exclude_binaries? and not #text?, `false` otherwise.
 - 
  
    
      #exclude_content?  ⇒ Bool 
    
    
  
  
  
  
  
  
  
  
  
    
`true` if Message#body matches an OptionGroups::Scope#exclude_content_patterns pattern, `false` otherwise.
 - 
  
    
      #initialize(response)  ⇒ Scope 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Scope.
 - 
  
    
      #out?  ⇒ Bool 
    
    
  
  
  
  
  
  
  
  
  
    
`true` if the Arachni::HTTP::Response is out of scope, `false` otherwise.
 
Methods inherited from URI::Scope
#auto_redundant?, #exclude?, #exclude_file_extension?, #follow_protocol?, #in?, #in_domain?, #include?, #redundant?, #too_deep?
Methods inherited from Scope
Constructor Details
#initialize(response) ⇒ Scope
Returns a new instance of Scope.
      27 28 29 30 31  | 
    
      # File 'lib/arachni/http/response/scope.rb', line 27 def initialize( response ) super response @response = response end  | 
  
Instance Method Details
#exclude_as_binary? ⇒ Bool
Returns `true` if OptionGroups::Scope#exclude_binaries? and not Arachni::HTTP::Response#text?, `false` otherwise.
      50 51 52  | 
    
      # File 'lib/arachni/http/response/scope.rb', line 50 def exclude_as_binary? .exclude_binaries? && !@response.text? end  | 
  
#exclude_content? ⇒ Bool
Returns `true` if Message#body matches an OptionGroups::Scope#exclude_content_patterns pattern, `false` otherwise.
      59 60 61  | 
    
      # File 'lib/arachni/http/response/scope.rb', line 59 def exclude_content? !!.exclude_content_patterns.find { |i| @response.body =~ i } end  | 
  
#out? ⇒ Bool
Also takes into account the URI::Scope of the Message#url.
Returns `true` if the Arachni::HTTP::Response is out of scope, `false` otherwise.
      41 42 43  | 
    
      # File 'lib/arachni/http/response/scope.rb', line 41 def out? super || exclude_as_binary? || exclude_content? end  |