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

Client does not report expected error code for 431 HTTP status #11248

Open
jhump opened this issue May 30, 2024 · 1 comment
Open

Client does not report expected error code for 431 HTTP status #11248

jhump opened this issue May 30, 2024 · 1 comment

Comments

@jhump
Copy link
Member

jhump commented May 30, 2024

A well-formed gRPC response always has an HTTP status code of “200 OK”. The gRPC docs specify a table for mapping other HTTP status codes to gRPC error codes: https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md.

The client in this repo mostly conforms to this table. This was tested with responses that include a variety of HTTP status codes but no body (and thus no “content-type” header) and no “grpc-status” header. The status codes tested include all values in the table linked above as well as a sampling of other codes (to test the last line of the table, which states that all other HTTP status codes should map to an unknown error code).

The one issue uncovered was for HTTP status 431 (Request Header Fields Too Large). Per the table, this HTTP status should result in an unknown error code. However it instead results in an internal error code.

@ejona86
Copy link
Member

ejona86 commented May 30, 2024

Heh. There's a TODO saying to update the spec.

// TODO(carl-mastrangelo): this should be added to the http-grpc-status-mapping.md doc.

It was added in d5eb248

I suspect that was because the server-side behavior changed from a RST_STREAM to HEADERS with error. It would be fair to discuss cross-language what code is appropriate and use it instead of unknown.

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

No branches or pull requests

2 participants