lib/arachni/session.rb in arachni-1.0.6 vs lib/arachni/session.rb in arachni-1.1
- old
+ new
@@ -1,7 +1,7 @@
=begin
- Copyright 2010-2014 Tasos Laskos <tasos.laskos@arachni-scanner.com>
+ Copyright 2010-2015 Tasos Laskos <tasos.laskos@arachni-scanner.com>
This file is part of the Arachni Framework project and is subject to
redistribution and commercial restrictions. Please see the Arachni Framework
web site for more information on licensing and terms of use.
=end
@@ -220,21 +220,26 @@
#
# @raise [Error::NotConfigured]
# If not {#configured?}.
# @raise [Error::FormNotFound]
# If the form could not be found.
- def login
+ def login( raise = false )
fail Error::NotConfigured, 'Please configure the session first.' if !configured?
refresh_browser
- page = @login_sequence ? login_from_sequence : login_from_configuration
+ page = nil
+ exception_jail raise do
+ page = @login_sequence ? login_from_sequence : login_from_configuration
+ end
if has_browser?
http.update_cookies browser.cookies
end
page
+ ensure
+ shutdown_browser
end
# @param [Block] block
# Block to be passed the {#browser}.
def with_browser( &block )