Commit cd49dc4
committed
fix(status): prevent panic on invalid base64 in grpc-status-details-bin
Instead of panicking with `.expect()` when base64 decoding of the
`grpc-status-details-bin` header fails, fall back to setting the status
code to `Unknown` and include the decoding error in the message. This is
consistent with how Tonic handles failures to decode the `grpc-message`
header.
Added a unit test `details_invalid_base64` to verify this behavior.1 parent f9a885b commit cd49dc4
1 file changed
Lines changed: 32 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
| 476 | + | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
480 | | - | |
481 | | - | |
| 479 | + | |
| 480 | + | |
482 | 481 | | |
483 | 482 | | |
484 | 483 | | |
| |||
489 | 488 | | |
490 | 489 | | |
491 | 490 | | |
492 | | - | |
493 | | - | |
494 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
495 | 494 | | |
496 | 495 | | |
497 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
498 | 502 | | |
499 | 503 | | |
500 | 504 | | |
| |||
1077 | 1081 | | |
1078 | 1082 | | |
1079 | 1083 | | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1080 | 1104 | | |
1081 | 1105 | | |
1082 | 1106 | | |
| |||
0 commit comments