Skip to content

Commit

Permalink
Merge pull request #126 from chilicheech/cookies
Browse files Browse the repository at this point in the history
enabling the use of cookies
  • Loading branch information
arangamani committed Mar 11, 2014
2 parents 8c23f38 + 5cf5fec commit ecb114a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/jenkins_api_client/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class Client
"timeout",
"ssl",
"follow_redirects",
"identity_file"
"identity_file",
"cookies"
].freeze

# Initialize a Client object with Jenkins CI server credentials
Expand All @@ -87,6 +88,7 @@ class Client
# @option args [String] :log_location (STDOUT) the location for the log file
# @option args [Fixnum] :log_level (Logger::INFO) The level for messages to be logged. Should be one of:
# Logger::DEBUG (0), Logger::INFO (1), Logger::WARN (2), Logger::ERROR (2), Logger::FATAL (3)
# @option args [String] :cookies Cookies to be sent with all requests in the format: name=value; name2=value2
#
# @return [JenkinsApi::Client] a client object to Jenkins API
#
Expand Down Expand Up @@ -249,6 +251,7 @@ def inspect
#
def make_http_request(request, follow_redirect = @follow_redirects)
request.basic_auth @username, @password if @username
request['Cookie'] = @cookies if @cookies

if @proxy_ip
http = Net::HTTP::Proxy(@proxy_ip, @proxy_port).new(@server_ip, @server_port)
Expand Down

0 comments on commit ecb114a

Please sign in to comment.