mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
ipn/localapi: require write access to PATCH prefs
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
3d81e6260b
commit
303805a389
@ -228,6 +228,10 @@ func (h *Handler) servePrefs(w http.ResponseWriter, r *http.Request) {
|
||||
var prefs *ipn.Prefs
|
||||
switch r.Method {
|
||||
case "PATCH":
|
||||
if !h.PermitWrite {
|
||||
http.Error(w, "prefs write access denied", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
mp := new(ipn.MaskedPrefs)
|
||||
if err := json.NewDecoder(r.Body).Decode(mp); err != nil {
|
||||
http.Error(w, err.Error(), 400)
|
||||
|
Loading…
Reference in New Issue
Block a user