Class: Arachni::State::HTTP
Overview
Instance Attribute Summary collapse
-
#cookie_jar ⇒ CookieJar
readonly
Cookie-jar for HTTP::Client#cookie_jar.
-
#headers ⇒ Hash
readonly
HTTP headers for the HTTP::Client#headers.
Class Method Summary collapse
Instance Method Summary collapse
- #clear ⇒ Object
- #dump(directory) ⇒ Object
-
#initialize ⇒ HTTP
constructor
A new instance of HTTP.
- #statistics ⇒ Object
Constructor Details
Instance Attribute Details
#cookie_jar ⇒ CookieJar (readonly)
Returns Cookie-jar for HTTP::Client#cookie_jar.
21 22 23 |
# File 'lib/arachni/state/http.rb', line 21 def @cookie_jar end |
#headers ⇒ Hash (readonly)
Returns HTTP headers for the HTTP::Client#headers.
17 18 19 |
# File 'lib/arachni/state/http.rb', line 17 def headers @headers end |
Class Method Details
Instance Method Details
#clear ⇒ Object
52 53 54 55 |
# File 'lib/arachni/state/http.rb', line 52 def clear @cookie_jar.clear @headers.clear end |
#dump(directory) ⇒ Object
34 35 36 37 38 39 40 |
# 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 ⇒ Object
28 29 30 31 32 |
# File 'lib/arachni/state/http.rb', line 28 def statistics { cookies: @cookie_jar..map(&:to_s).uniq } end |