Merge pull request #4511 from gohai/fix-downloader

Fix Downloader
This commit is contained in:
Ben Fry
2016-06-02 16:21:24 -04:00
2 changed files with 6 additions and 4 deletions

View File

@@ -835,11 +835,11 @@
-->
<!-- use the jre subfolder when having downloaded a JDK file -->
<condition property="jre.dir" value="jdk${jdk.esoteric}/jre/">
<condition property="jre.dir" value="jdk${jdk.esoteric}/jre">
<!-- property might not be set, but it is for arm -->
<equals arg1="${jre.download.jdk}" arg2="true" />
</condition>
<condition property="jre.dir" value="jre${jdk.esoteric}/">
<condition property="jre.dir" value="jre${jdk.esoteric}">
<not>
<equals arg1="${jre.download.jdk}" arg2="true" />
</not>

View File

@@ -158,8 +158,10 @@ public class Downloader extends Task {
}
List<String> cookies = headers.get("Set-Cookie");
conn = (HttpURLConnection) new URL(url).openConnection();
for (String cookie : cookies) {
conn.setRequestProperty("Cookie", cookie);
if (cookies != null) {
for (String cookie : cookies) {
conn.setRequestProperty("Cookie", cookie);
}
}
conn.setRequestProperty("Cookie", COOKIE);
conn.connect();