class Arachni::State::HTTP

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

Attributes

headers[R]

@return [Hash]

HTTP headers for the {Arachni::HTTP::Client#headers}.

Public Class Methods

load( directory ) click to toggle source
# File lib/arachni/state/http.rb, line 42
def self.load( directory )
    http = new

    %w(headers cookie_jar).each do |attribute|
        http.send(attribute).merge! Marshal.load( IO.binread( "#{directory}/#{attribute}" ) )
    end

    http
end
new() click to toggle source
# File lib/arachni/state/http.rb, line 23
def initialize
    @headers    = Arachni::HTTP::Headers.new
    @cookie_jar = Arachni::HTTP::CookieJar.new
end

Public Instance Methods

clear() click to toggle source
# File lib/arachni/state/http.rb, line 52
def clear
    @cookie_jar.clear
    @headers.clear
end
dump( directory ) click to toggle source
# File lib/arachni/state/http.rb, line 34
def dump( directory )
    FileUtils.mkdir_p( directory )

    %w(headers cookie_jar).each do |attribute|
        IO.binwrite( "#{directory}/#{attribute}", Marshal.dump( send(attribute) ) )
    end
end
statistics() click to toggle source
# File lib/arachni/state/http.rb, line 28
def statistics
    {
        cookies: @cookie_jar.cookies.map(&:to_s).uniq
    }
end