Fixed blacklist not working when empty (because, exists is true if the list is empty...)

This commit is contained in:
Florian Nücke 2014-06-04 12:58:26 +02:00
parent 4931f8e84a
commit cb69a4b386

View File

@ -213,7 +213,7 @@ object InternetCard {
if (Settings.get.httpHostWhitelist.length > 0 && !Settings.get.httpHostWhitelist.exists(_(inetAddress, host))) {
throw new FileNotFoundException("address is not whitelisted")
}
if (Settings.get.httpHostBlacklist.exists(_(inetAddress, host))) {
if (Settings.get.httpHostBlacklist.length > 0 && Settings.get.httpHostBlacklist.exists(_(inetAddress, host))) {
throw new FileNotFoundException("address is blacklisted")
}
}