-
Notifications
You must be signed in to change notification settings - Fork 81
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
Disregard non-JSON error response bodies #695
Merged
Merged
Conversation
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
smaye81
changed the title
Sayers/disregard json on error
Disregard non-JSON error response bodies
Jun 28, 2023
new Headers({ | ||
"Content-Type": "application/proto", | ||
}) | ||
); | ||
} catch (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will pass even if validate response never throws. It is missing a fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks for catching that
srikrsna-buf
approved these changes
Jun 28, 2023
This was referenced Jun 28, 2023
Merged
smaye81
added a commit
to connectrpc/conformance
that referenced
this pull request
Jun 29, 2023
This adds a new Connect server using `connect-fastify` and `connect-node`. It wires it into the docker-compose setup and allows for serving HTTP/1.1 and HTTP/2 traffic using cleartext and TLS. Fastify does not offer HTTP/3 support as of yet, so that path is not available. Note: this does not yet use TLS, but can be added as a follow-up PR. In addition, this also refactors a few things such as: * adds TypeScript support to the web portion * renames images, Dockerfiles, etc. to match the language so that adding new languages can follow one pattern. For example, `client-connect-to-server-connect-go-h2` becomes `client-connect-go-to-server-connect-go-h2` and uses `Dockerfile.crosstestgo` instead of `Dockerfile.crosstest`. * updates to connect-go v1.9.0 for https://github.com/bufbuild/connect-go/pull/528 which fixes an issue with parsing response headers from a connect-node server. * updates to connect-es v0.11.0 for connectrpc/connect-es#695, which fixes an issue with parsing response bodies for non-JSON content types.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR modifies the response validation so that Connect will only attempt to parse the body of a unary error if the content type is
application/json
.For all other error responses, the body is ignored and the code and message is built from the received HTTP error status and it's corresponding Connect error code.