Audit changes.

This commit is contained in:
jdl
2026-06-13 15:06:14 +02:00
parent fe5f26ed70
commit 528e67ea61
2 changed files with 10 additions and 3 deletions

View File

@@ -268,9 +268,11 @@ func (a *App) _peerInit(peer *api.Peer, w http.ResponseWriter, r *http.Request)
return nil
}
r.Body = http.MaxBytesReader(w, r.Body, 2048)
args := m.PeerInitArgs{}
if err := json.NewDecoder(r.Body).Decode(&args); err != nil {
return err
return errs.BadRequest.WithMsg("Invalid request body.")
}
if len(args.WGPubKey) != 32 {