diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-14 17:35:41 -0400 |
---|---|---|
committer | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-14 17:35:41 -0400 |
commit | 2c2343b48df587ce205b14d24133d8280abc1a62 (patch) | |
tree | 7db4520fe3f606ad622881c69200d8e823723e7d /pkg/api/api0/accounts.go | |
parent | 72c2467e8ea056261110d89e6590168ef8d25ffc (diff) | |
download | Atlas-2c2343b48df587ce205b14d24133d8280abc1a62.tar.gz Atlas-2c2343b48df587ce205b14d24133d8280abc1a62.zip |
pkg/api/api0: Relax /accounts/write_persistence serverId check for listen server
Diffstat (limited to 'pkg/api/api0/accounts.go')
-rw-r--r-- | pkg/api/api0/accounts.go | 12 |
1 files changed, 3 insertions, 9 deletions
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 { |