grpc-gateway
grpc-gateway copied to clipboard
Incorrect mapping from grpc code to http code for `canceled request`.
🐛 Bug Report
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 CANCELLED grpc code is 499 (Client Closed Request), and not 408 (StatusRequestTimeout).
To Reproduce
Implement the HTTPStatusFromCode method from the runtime pkg, and see the incorrect mapping for Canceled GRPC code.
Expected behavior
GRPC Canceled code must be mapped to http code 499 (Client Closed Request), instead of 408 (StatusRequestTimeout).
Actual Behavior
GRPC Canceled code maps to http 408 (StatusRequestTimeout).
Huh, I could've sworn I went and checked these. Thank you for your issue and the PR!
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.
I would like to contribute to fix this issue. Thank you!!
Hi, please feel free to open a new PR, we haven't heard anything from @brijeshvishwanath for a while.
humm, .NET doesn't support 499 status code. Thread with discussion here 🧵 https://github.com/dotnet/aspnetcore/issues/41475
Non-standard or not, we should be consistent with the code.proto
definitions in our error conversions. I still think we want this change.
Hi @johanbrandhorst, Created PR to contribute this fix, please check.