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:
parent
bd85fdc084
commit
183e1c9ff6
@ -41,8 +41,8 @@ import processing.app.PreferencesData;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static processing.app.I18n.format;
|
import static processing.app.I18n.format;
|
||||||
import static processing.app.I18n.tr;
|
import static processing.app.I18n.tr;
|
||||||
@ -184,7 +184,12 @@ public class DownloadableContributionsDownloader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean verifyDomain(URL url) {
|
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) {
|
if (domain.size() == 0) {
|
||||||
// Default domain
|
// Default domain
|
||||||
domain.add("downloads.arduino.cc");
|
domain.add("downloads.arduino.cc");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user