Skip to content

Commit

Permalink
Setup CookieHandler
Browse files Browse the repository at this point in the history
This commit sets up a CookieManager and makes the system-wide
CookieHandler use it. Starting from Jenkins LTS 2.176.2 a valid Web
Session for which the crumb was issued is also required unless
configured otherwise.
  • Loading branch information
jokogr committed Apr 8, 2020
1 parent 119acef commit aeac218
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.Serializable;
import java.net.CookieHandler;
import java.net.CookieManager;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -133,6 +135,8 @@ public class RemoteBuildConfiguration extends Builder implements SimpleBuildStep

@DataBoundConstructor
public RemoteBuildConfiguration() {
CookieManager cookieManager = new CookieManager();
CookieHandler.setDefault(cookieManager);
pollInterval = DEFAULT_POLLINTERVALL;
}

Expand Down

0 comments on commit aeac218

Please sign in to comment.