-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update connect-go dependency to latest (#126)
Some of the updated behavior in connect-go tickled some bugs in vanguard, which were caught by the tests. These issues are fixed in this change: 1. When the `envelopingReader` was transforming an un-enveloped body (for Connect unary) to an enveloped one, it would include an extra, second, invalid envelope(!!). This wasn't previously caught because the older version of connect-go only tried to read a single request for unary RPCs and then effectively ignored the rest of the body. The newer connect-go validates that the client isn't erroneously sending more than one message, which brought this bug to light. 2. The "content-type" response header was not being correctly set when translating a Connect unary error (JSON response body) to gRPC. This wasn't previously caught because the older version of connect-go failed to validate the response content-type. The newer version does validate the content-type, so complains when it is empty since it should always be set for gRPC and gRPC-Web responses (even if the body is empty). 3. If the "content-length" header was set, the vanguard transcoder was failing to correctly enforce the max buffer size limit. This wasn't previously caught because the older connect-go never set the "content-length" header; but now it will be set for unary and server-stream operations, which tickled this bug. Luckily, we had a test case to catch it. The other changes necessary to get tests to pass were changes to make vanguard's test code more robust: 1. It was using `assert.Equal` on a `*connect.Error`, which may contain `proto.Message` instances if there are error details, which do not correctly compare with `assert.Error`. I've extract the comparison to a helper that checks all of the error properties and uses `protocmp` to compare the message values. 2. It was assuming a content-type of "application/grpc+proto" for gRPC requests with a proto codec, but the newer connect-go version will now shorten this to simply "application/grpc". So the assertions here were relaxed accordingly.
- Loading branch information
Showing
6 changed files
with
49 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters