-
Notifications
You must be signed in to change notification settings - Fork 997
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
Details field in Status struct is not decoded properly #349
Comments
While I still suspect there's a problem with missing Before this PR #345, any bytes passed with This broke some tests I had that relied on the previous behavior. Basically, I manually implemented base64 encoding/decode to work around the fact that tonic didn't do that. |
I wrote these to reproduce hyperium#349, and in the process proved to myself that my bug report is not correct. However at least there are tests to prove it now.
Sorry for the mistaken bug report. The change to the behavior of FWIW, I proved this to myself with a unit test, since the existing test code around custom details values was pretty minimal: |
Bug Report
A recent change (#345) added base64 encode/decode to the custom
details
member ofStatus
. Unfortunately it was not implemented properly, and as a result the details sent by the server are not the details received by the client.Version
tonic v0.2.1
Platform
Linux shannon.assur.io 5.6.11-300.fc32.x86_64 #1 SMP Wed May 6 19:12:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Crates
tonic
Description
The test in #345 is inadequate, as it tests only with a custom
details
value of&[1]
, meaning a single byte with value 0x01.The encoding logic uses the
base64
crate with an explicit config:tonic/tonic/src/status.rs
Line 457 in 372da52
That part is correct. The decode logic on the other hand is incorrect:
tonic/tonic/src/status.rs
Lines 348 to 349 in 372da52
It should be using
decode_config
withbase64::STANDARD_NO_PAD
.The text was updated successfully, but these errors were encountered: