Skip to content

Commit

Permalink
Fixes #126 Set cookie handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sstrickx committed May 1, 2018
1 parent 34b34d3 commit ddd9c5a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/yahoofinance/util/RedirectableRequest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package yahoofinance.util;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.net.*;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -19,6 +17,10 @@ public class RedirectableRequest {
private int connectTimeout = 10000;
private int readTimeout = 10000;

static {
CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));
}

public RedirectableRequest(URL request) {
this(request, 2);
}
Expand Down

0 comments on commit ddd9c5a

Please sign in to comment.