An HTTP middleware to manage storing/sending cookies in HTTP requests. Most HTTP communication in Chef does not need cookies, it was originally implemented to support OpenID, but it’s not known who might be relying on it, so it’s included with Chef::REST
# File lib/chef/http/cookie_manager.rb, line 34 def handle_request(method, url, headers={}, data=false) @host, @port = url.host, url.port if @cookies.has_key?("#{@host}:#{@port}") headers['Cookie'] = @cookies["#{@host}:#{@port}"] end [method, url, headers, data] end
# File lib/chef/http/cookie_manager.rb, line 42 def handle_response(http_response, rest_request, return_value) if http_response['set-cookie'] @cookies["#{@host}:#{@port}"] = http_response['set-cookie'] end [http_response, rest_request, return_value] end
Generated with the Darkfish Rdoc Generator 2.