From 2c2343b48df587ce205b14d24133d8280abc1a62 Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Fri, 14 Oct 2022 17:35:41 -0400 Subject: pkg/api/api0: Relax /accounts/write_persistence serverId check for listen server --- pkg/api/api0/accounts.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'pkg/api/api0') diff --git a/pkg/api/api0/accounts.go b/pkg/api/api0/accounts.go index d3fc120..a19a908 100644 --- a/pkg/api/api0/accounts.go +++ b/pkg/api/api0/accounts.go @@ -114,16 +114,10 @@ func (h *Handler) handleAccountsWritePersistence(w http.ResponseWriter, r *http. return } - serverID := r.URL.Query().Get("serverId") - if serverID == "" { - respJSON(w, r, http.StatusBadRequest, map[string]any{ - "success": false, - "error": ErrorCode_BAD_REQUEST, - "msg": ErrorCode_BAD_REQUEST.Messagef("serverId param is required"), - }) - return + serverID := r.URL.Query().Get("serverId") // blank on listen server + if serverID != "" { + // TODO: check serverID } - // TODO: check serverID raddr, err := netip.ParseAddrPort(r.RemoteAddr) if err != nil { -- cgit v1.2.3