lib/arachni/page.rb in arachni-0.4.1 vs lib/arachni/page.rb in arachni-0.4.1.1
- old
+ new
@@ -57,10 +57,15 @@
attr_reader :headers
#
# @return [Hash]
#
+ attr_reader :request_headers
+
+ #
+ # @return [Hash]
+ #
attr_reader :response_headers
# @return [Array<String>]
attr_reader :paths
@@ -114,21 +119,22 @@
Parser.new( res, opts ).page
end
class << self; alias :from_http_response :from_response end
def initialize( opts = {} )
- @forms = []
- @links = []
- @cookies = []
- @headers = []
+ opts.each { |k, v| instance_variable_set( "@#{k}".to_sym, try_dup( v ) ) }
- @cookiejar = {}
- @paths = []
+ @forms ||= []
+ @links ||= []
+ @cookies ||= []
+ @headers ||= []
- @response_headers = {}
- @query_vars = {}
+ @cookiejar ||= {}
+ @paths ||= []
- opts.each { |k, v| instance_variable_set( "@#{k}".to_sym, try_dup( v ) ) }
+ @response_headers ||= {}
+ @request_headers ||= {}
+ @query_vars ||= {}
@url = Utilities.normalize_url( @url )
@body ||= ''
end