Skip to content

Only use trailers-only response in grpc-web when there are no custom headers#677

Merged
jhump merged 1 commit intomainfrom
jh/grpc-web-clarifications
Feb 7, 2024
Merged

Only use trailers-only response in grpc-web when there are no custom headers#677
jhump merged 1 commit intomainfrom
jh/grpc-web-clarifications

Conversation

@jhump
Copy link
Member

@jhump jhump commented Feb 2, 2024

I pulled this commit into the conformance repo to verify that this change is compatible with the official gRPC-Web JS client. In fact, I added some conformance test cases around it (connectrpc/conformance#770) to verify that a gRPC-Web client will correctly accept both forms of "empty" response (for both unary and streams):

  1. Headers, no response messages, trailers in the body
  2. Trailers-only (where trailers are in HTTP headers)

The only issue with the gRPC-Web JS client was that it doesn't like it when in-body trailers contains a key more than once. It doesn't fail, but later values overwrite earlier ones instead of it merging all of the values. (I went ahead and filed a bug for it: grpc/grpc-web#1399. It's trivial to fix, so I might open a pull request, too.)

@jhump jhump requested a review from akshayjshah February 3, 2024 02:26
@jhump jhump merged commit c83ce94 into main Feb 7, 2024
@jhump jhump deleted the jh/grpc-web-clarifications branch February 7, 2024 01:50
@jhump jhump added the bug Something isn't working label Feb 16, 2024
@jhump jhump mentioned this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants