mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-07 16:32:51 +03:00
Pull request: imp-json-resp
Merge in DNS/adguard-home from imp-json-resp to master Squashed commit of the following: commit 44532b6fa551815e5ea876e7320ce0a73c32b6fb Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Sep 30 15:59:58 2022 +0300 all: imp json resp
This commit is contained in:
parent
bf792b83f6
commit
c26ab190e7
10 changed files with 35 additions and 140 deletions
internal/dhcpd
|
@ -78,18 +78,7 @@ func (s *server) handleDHCPStatus(w http.ResponseWriter, r *http.Request) {
|
|||
status.Leases = s.Leases(LeasesDynamic)
|
||||
status.StaticLeases = s.Leases(LeasesStatic)
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
err := json.NewEncoder(w).Encode(status)
|
||||
if err != nil {
|
||||
aghhttp.Error(
|
||||
r,
|
||||
w,
|
||||
http.StatusInternalServerError,
|
||||
"Unable to marshal DHCP status json: %s",
|
||||
err,
|
||||
)
|
||||
}
|
||||
_ = aghhttp.WriteJSONResponse(w, r, status)
|
||||
}
|
||||
|
||||
func (s *server) enableDHCP(ifaceName string) (code int, err error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue