Skip to content

WARDOGS kill endpoint fails when POST request has no JSON body #53

Open

Description

@speccycy

Problem

On a current live WARDOGS server, Warcon's Kill action fails because it sends:

POST /v1/players/{steamId}/kill

without a request body.

The WARDOGS server responds with:

HTTP 501 Not Implemented
{
  "error": {
    "code": "unsupported_transfer_encoding",
    "message": "The request could not be parsed."
  }
}

This affects actions that use the kill endpoint, including:

  • Manual Kill from the Players page
  • AFK Protection / automation using ACTIONS.kill
  • The respawn kill after changeTeam

Reproduction

A POST request without a body fails:

curl --http1.1 -X POST \
  "https://<rcon-host>/v1/players/<steamId>/kill" \
  -H "Authorization: Bearer <password>"

Result:

{
  "error": {
    "code": "unsupported_transfer_encoding",
    "message": "The request could not be parsed."
  }
}

Sending an empty JSON object succeeds:

curl --http1.1 -X POST \
  "https://<rcon-host>/v1/players/<steamId>/kill" \
  -H "Authorization: Bearer <password>" \
  -H "Content-Type: application/json" \
  --data '{}'

Result:

{
  "ok": true,
  "pending": false,
  "message": "OK: killed Player."
}

Current Warcon implementation

The current Kill action sends the request without a body:

run: (c, p) => c.json('POST', `/v1/players/${steamId(p.steamId)}/kill`)

The respawn kill in changeTeam does the same:

await c.json('POST', `/v1/players/${id}/kill`);

Sending an empty JSON object fixes both cases:

run: (c, p) => c.json('POST', `/v1/players/${steamId(p.steamId)}/kill`, {})

and:

await c.json('POST', `/v1/players/${id}/kill`, {});

Pull request

A fix and regression tests are already available in:

#45

This was reproduced against a live WARDOGS server.

It appears newer/current WARDOGS builds require the Kill POST request to contain a JSON body, even though the endpoint itself does not otherwise require parameters.

Without a body the server returns 501 unsupported_transfer_encoding; with {} the same request succeeds.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions