Fix #727 - use default parental sensitivity when it's not set

This commit is contained in:
Andrey Meshkov
2019-06-06 22:42:17 +03:00
parent f9807e4011
commit 07db927246
4 changed files with 14 additions and 9 deletions

4
dns.go
View File

@@ -216,7 +216,7 @@ func generateServerConfig() dnsforward.ServerConfig {
// If a client has his own settings, apply them
func applyClientSettings(clientAddr string, setts *dnsfilter.RequestFilteringSettings) {
c, ok := clientFind(clientAddr)
if !ok || !c.UseOwnSettings {
if !ok || c == nil || !c.UseOwnSettings {
return
}
@@ -224,7 +224,7 @@ func applyClientSettings(clientAddr string, setts *dnsfilter.RequestFilteringSet
setts.FilteringEnabled = c.FilteringEnabled
setts.SafeSearchEnabled = c.SafeSearchEnabled
setts.SafeBrowsingEnabled = c.SafeBrowsingEnabled
setts.ParentalEnabled = c.UseOwnSettings
setts.ParentalEnabled = c.ParentalEnabled
}
func startDNSServer() error {