Skip to content

Revise code mappings per latest changes to spec#706

Merged
jhump merged 1 commit intomainfrom
jh/update-code-mapping
Mar 12, 2024
Merged

Revise code mappings per latest changes to spec#706
jhump merged 1 commit intomainfrom
jh/update-code-mapping

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.

@jhump jhump requested review from akshayjshah and emcfarlane March 12, 2024 02:01
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
Contributor

@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.

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