mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-15 18:08:30 -07:00
Fix yaml marshalling panic.
This commit is contained in:
parent
9294c9ecb2
commit
96fbf7f134
@ -52,7 +52,7 @@ var defaultDNS = []string{"tls://1.1.1.1", "tls://1.0.0.1"}
|
||||
|
||||
// field ordering is important -- yaml fields will mirror ordering from here
|
||||
type dhcpState struct {
|
||||
dhcpConfig
|
||||
Config dhcpConfig
|
||||
Leases []dhcpLease
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ var config = configuration{
|
||||
{Filter: dnsfilter.Filter{ID: 3}, Enabled: false, URL: "https://hosts-file.net/ad_servers.txt", Name: "hpHosts - Ad and Tracking servers only"},
|
||||
{Filter: dnsfilter.Filter{ID: 4}, Enabled: false, URL: "http://www.malwaredomainlist.com/hostslist/hosts.txt", Name: "MalwareDomainList.com Hosts List"},
|
||||
},
|
||||
DHCP: dhcpState{dhcpConfig: dhcpConfig{
|
||||
DHCP: dhcpState{Config: dhcpConfig{
|
||||
LeaseDuration: time.Hour * 12,
|
||||
}},
|
||||
SchemaVersion: currentSchemaVersion,
|
||||
|
4
dhcp.go
4
dhcp.go
@ -8,7 +8,7 @@ import (
|
||||
|
||||
func handleDHCPStatus(w http.ResponseWriter, r *http.Request) {
|
||||
status := map[string]interface{}{
|
||||
"config": config.DHCP.dhcpConfig,
|
||||
"config": config.DHCP.Config,
|
||||
"leases": config.DHCP.Leases,
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ func handleDHCPSetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
config.DHCP.dhcpConfig = newconfig
|
||||
config.DHCP.Config = newconfig
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
|
Loading…
Reference in New Issue
Block a user