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

Revise code mappings per latest changes to spec #706

Merged
merged 1 commit into from
Mar 12, 2024
Merged

Conversation

jhump
Copy link
Member

@jhump jhump commented Mar 12, 2024

This reconciles the implementation in this repo with the recent adjustments to HTTP<->Connect code mappings (connectrpc/connectrpc.com#130).

The gRPC and Connect mappings from HTTP code to RPC code are now aligned, so I've unified them into a single function.

@@ -231,7 +231,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
resp, err := client.Do(req)
assert.Nil(t, err)
defer resp.Body.Close()
assert.Equal(t, resp.StatusCode, http.StatusNotFound)
assert.Equal(t, resp.StatusCode, http.StatusNotImplemented)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one case where this mapping makes a lot more sense: when the server receives an unrecognized content-encoding, it returns an "unimplemented" status error. And 501 makes way more sense than 404. (Ideally it would be 415, but let's take what we can get 😆)

Copy link
Member

@akshayjshah akshayjshah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Somehow I expected this to be a more involved change.

@jhump jhump merged commit e3f35a6 into main Mar 12, 2024
13 checks passed
@jhump jhump deleted the jh/update-code-mapping branch March 12, 2024 13:12
@jhump jhump mentioned this pull request Mar 20, 2024
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

Successfully merging this pull request may close these issues.

2 participants