From a89622cf98de88c547bb2a93872e3bd82322c301 Mon Sep 17 00:00:00 2001
From: kireto <k.mitov@robopartans.com>
Date: Thu, 15 Oct 2020 00:24:10 +0300
Subject: [PATCH] Preserving the cookie when requesting a crumb from
 crumbIssuer and then sending a post for a build.

The post will include the same cookie
---
 lib/jenkins_api_client/client.rb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/jenkins_api_client/client.rb b/lib/jenkins_api_client/client.rb
index cee4c2cb..054f9c28 100644
--- a/lib/jenkins_api_client/client.rb
+++ b/lib/jenkins_api_client/client.rb
@@ -369,6 +369,7 @@ def make_http_request(request, follow_redirect = @follow_redirects)
       http.read_timeout = @http_read_timeout
 
       response = http.request(request)
+      @cookies = response["set-cookie"]
       case response
         when Net::HTTPRedirection then
           # If we got a redirect request, follow it (if flag set), but don't