Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST handlers silently ignore request body if unexpected #76694

Closed
DaveCTurner opened this issue Aug 19, 2021 · 3 comments
Closed

REST handlers silently ignore request body if unexpected #76694

DaveCTurner opened this issue Aug 19, 2021 · 3 comments
Labels
>bug :Core/Infra/REST API REST infrastructure and utilities Team:Core/Infra Meta label for core/infra team

Comments

@DaveCTurner
Copy link
Contributor

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.

@DaveCTurner DaveCTurner added >bug :Core/Infra/REST API REST infrastructure and utilities labels Aug 19, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Aug 19, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@rjernst
Copy link
Member

rjernst commented Aug 19, 2021

What version was this on? That should have been fixed already in 7.0: #37504

@DaveCTurner
Copy link
Contributor Author

Bah sorry for the noise, I guess they must have been using 6.8.x. It does look to be fixed indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/REST API REST infrastructure and utilities Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

3 participants