grpc-gateway
grpc-gateway copied to clipboard
Incorrect mapping from grpc code to http code for canceled request.
Fixes #2707
Brief description of what is fixed or changed
Incorrect mapping from grpc code to http code for canceled request.
The reference for error mapping in HTTPStatusFromCode is followed from: https://github.com/googleapis/googleapis/blob/942691f8dcf3e521be35d909de9bba3239feb471/google/rpc/code.proto#L40 And the reference claims that http code mapping for CANCELED grpc code is 499 (Client Closed Request), and not 408 (StatusRequestTimeout).
This MR changes this mapping.
Note: HTTP error code 499 const is not supported by go http pkg, hence I have used the integer literal.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
For more information, open the CLA check for this pull request.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Ping, could you please sign the CLA to have this merged?
This has been contributed by someone else.