aboutsummaryrefslogtreecommitdiff
path: root/pkg/api/api0
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-14 17:35:41 -0400
committerpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-14 17:35:41 -0400
commit2c2343b48df587ce205b14d24133d8280abc1a62 (patch)
tree7db4520fe3f606ad622881c69200d8e823723e7d /pkg/api/api0
parent72c2467e8ea056261110d89e6590168ef8d25ffc (diff)
downloadAtlas-2c2343b48df587ce205b14d24133d8280abc1a62.tar.gz
Atlas-2c2343b48df587ce205b14d24133d8280abc1a62.zip
pkg/api/api0: Relax /accounts/write_persistence serverId check for listen server
Diffstat (limited to 'pkg/api/api0')
-rw-r--r--pkg/api/api0/accounts.go12
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 {