Class: Splunk::Pickaxe::CookieProxy
- Inherits:
-
Net::HTTP
- Object
- Net::HTTP
- Splunk::Pickaxe::CookieProxy
- Defined in:
- lib/splunk/pickaxe/cookie_proxy.rb
Instance Method Summary collapse
-
#request(req, body = nil, &block) ⇒ Object
:yield:
response
.
Instance Method Details
#request(req, body = nil, &block) ⇒ Object
:yield: response
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/splunk/pickaxe/cookie_proxy.rb', line 8 def request(req, body = nil, &block) # :yield: +response+ if @@cookies req['Cookie'] = @@cookies end r = super(req,body,&block) c = r.to_hash['set-cookie'] if c @@cookies = c.collect{|ea|ea[/^.*?;/]}.join end return r end |