Skip to content

Make StreamableClientTransport less strict by default #521

@findleyr

Description

@findleyr

Internal users at Google are reporting problems using the StreamableClientTransport to communicate with various backends, because it is strict and fails the connection at the first spec violation it observes. In some cases, these violations are recoverable. We should make the client less strict by default, because it should do the best it can and work as often as possible.

For example:

  • If the hanging GET encounters 404 instead of 405, it treats it as a signal that the session is not found and closes the connection (this was also reported externally as failed to reconnect: Not Found after initalize in stateless HTTP POST server #393. We can treat a 404 like a 405 for the hanging GET.
  • If the server returns 200 instead of 202 for a notification or response, we try to read the body and fail. Again, the spec says that servers must return 202, but if we know there should be no response content we can treat a 200 equivalently.

Now, I think we should also have a "strict mode", but that can be enabled by StreamableClientTransport.Strict. Will leave that to another proposal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions