rpc: allow dumb empty requests for AWS health checks #15496
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A while back, in #15220 we've introduced an extra limitation in our HTTP RPC to reject all requests that do not have
application/json
as the content type. This was needed to prevent the circumvention of CORS checks in certain browsers.This however meant that dumb, empty HTTP GET requests now return a failure. Whilst this sounds a good idea, it also breaks the AWS load balancer health checks, as those simply issue a GET on load balanced ports and kill the backing services if they don't reply with 200 #15490.
This PR makes a special case exception, so that if someone sends an empty HTTP GET request to our HTTP RPC endpoint, instead of rejecting it, we just return immediately, causing a 200 code.