ipn/ipnlocal: use ipn.PrefsView

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2022-10-23 17:07:10 +00:00
committed by Maisem Ali
parent 20324eeebc
commit 0957bc5af2
11 changed files with 181 additions and 184 deletions

View File

@@ -505,7 +505,7 @@ func (h *Handler) servePrefs(w http.ResponseWriter, r *http.Request) {
http.Error(w, "prefs access denied", http.StatusForbidden)
return
}
var prefs *ipn.Prefs
var prefs ipn.PrefsView
switch r.Method {
case "PATCH":
if !h.PermitWrite {
@@ -526,7 +526,7 @@ func (h *Handler) servePrefs(w http.ResponseWriter, r *http.Request) {
return
}
case "GET", "HEAD":
prefs = h.b.Prefs()
prefs = h.b.Prefs().View()
default:
http.Error(w, "unsupported method", http.StatusMethodNotAllowed)
return