Skip to content

REST handlers silently ignore request body if unexpected #76694

@DaveCTurner

Description

@DaveCTurner

In https://discuss.elastic.co/t/ilm-retry-api-not-honoring-timeouts/281772 a user reported confusion over the way that Elasticsearch ignored the parameters in this request:

POST */_ilm/retry
{
  "timeout": "30m",
  "master_timeout": "30m"
}

The immediate solution was to move the parameters into the URL where they belong, but the question highlights a broader problem: if an API endpoint expects a request body then we parse the body fairly strictly and reject requests that contain unexpected things, but if the endpoint doesn't expect a body at all then we seem to leniently accept requests with a body anyway. Silently ignoring input like this is confusing, and I think we should have rejected this request with a 400 Bad request instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions