1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Proxy selection was using old logic when url resulted in 302

This commit is contained in:
Federico Fissore 2015-09-09 11:21:22 +02:00
parent 96e0ee2a67
commit 43d855c28b

View File

@ -145,7 +145,7 @@ public class FileDownloader extends Observable {
if (resp == HttpURLConnection.HTTP_MOVED_PERM || resp == HttpURLConnection.HTTP_MOVED_TEMP) { if (resp == HttpURLConnection.HTTP_MOVED_PERM || resp == HttpURLConnection.HTTP_MOVED_TEMP) {
URL newUrl = new URL(connection.getHeaderField("Location")); URL newUrl = new URL(connection.getHeaderField("Location"));
proxy = ProxySelector.getDefault().select(newUrl.toURI()).get(0); proxy = new CustomProxySelector(PreferencesData.getMap()).getProxyFor(newUrl.toURI());
// open the new connnection again // open the new connnection again
connection = (HttpURLConnection) newUrl.openConnection(proxy); connection = (HttpURLConnection) newUrl.openConnection(proxy);