Module: Gauntlt::Support::CookieHelper

Defined in:
lib/gauntlt/attack_adapters/support/cookie_helper.rb

Instance Method Summary collapse

Instance Method Details

#cookiesObject


12
13
14
15
16
# File 'lib/gauntlt/attack_adapters/support/cookie_helper.rb', line 12

def cookies
  raise "No cookies set" if @cookies.nil?

  @cookies
end

#cookies_for_last_curl_requestObject


4
5
6
7
8
9
10
# File 'lib/gauntlt/attack_adapters/support/cookie_helper.rb', line 4

def cookies_for_last_curl_request
  raise "no curl output found!" unless @raw_curl_response

  @raw_curl_response.scan(/^Set-Cookie:.+$/).map do |header|
    "#{$1}=#{$2}" if header =~ /^Set-Cookie: ([^=]+)=([^;]+;)/
  end
end

#set_cookies(a) ⇒ Object


18
19
20
# File 'lib/gauntlt/attack_adapters/support/cookie_helper.rb', line 18

def set_cookies(a)
  @cookies = a
end