1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-20 09:52:13 +01:00

Remove empty string from the http.signature_verify_domains preferences

This commit is contained in:
Mattia Bertorello 2019-07-05 12:36:18 +02:00
parent bd85fdc084
commit 183e1c9ff6
No known key found for this signature in database
GPG Key ID: CE1FB2BE91770F24

View File

@ -41,8 +41,8 @@ import processing.app.PreferencesData;
import java.io.File;
import java.net.URL;
import java.nio.file.*;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import static processing.app.I18n.format;
import static processing.app.I18n.tr;
@ -184,7 +184,12 @@ public class DownloadableContributionsDownloader {
}
public boolean verifyDomain(URL url) {
final List<String> domain = new LinkedList<>(PreferencesData.getCollection("http.signature_verify_domains"));
final List<String> domain = PreferencesData.
getCollection("http.signature_verify_domains")
.stream()
// Remove empty strings from the collection
.filter((v) -> !v.trim().isEmpty())
.collect(Collectors.toList());
if (domain.size() == 0) {
// Default domain
domain.add("downloads.arduino.cc");