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

spec: should include more details on how invalid requests and responses should be handled #169

Open
jhump opened this issue May 28, 2024 · 1 comment

Comments

@jhump
Copy link
Member

jhump commented May 28, 2024

The spec describes valid requests and a valid responses, but, aside from how to handle an invalid content-type for streams or unsupported message codec for unary, it does not indicate what actions a Connect server or client should take in the face of an invalid request or response.

On the server side:

  • How should a server handle a request with an unsupported method (i.e. anything but POST for most methods; anything but POST or GET for idempotent methods)?
  • How should a server handle a streaming request that indicates an unsupported codec?
  • It should be clarified that the response content-type for streaming calls must match the request content-type.
  • How should a server handle a streaming request for a server-stream operation that has an incorrect number of request messages (!= 1)?
  • How should a server handle a stream message that has the "compressed" bit set even though no compression is configured via content-encoding?

There are similar concerns with how a client should handle an invalid response.

  • How should a client handle a response with an invalid content-type?
  • How should a client handle an unsupported response content-encoding?
  • How should a client handle a streaming response with a non-200 HTTP status code?
  • How should a client handle a streaming response for a client-stream operation that has an incorrect number of request messages (!= 1)?
  • How should a client handle a stream message that has the "compressed" bit set even though no compression is configured via content-encoding?

The spec should be expanded to provide more clear guidance on expected behavior in the face of these kinds of errors.

@akshayjshah
Copy link
Member

All good points :) It'd be great for the spec to match the conformance tests on all of these points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants