fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.35k stars 497 forks source link

Fails to display response headers in case of "unexpected HTTP status code" #430

Open frederictobiasc opened 7 months ago

frederictobiasc commented 7 months ago

Current behavior: grpcurl incorrectly states Response headers received: (empty) despite response headers being present in case there is an unexpected status code (like 401). Expected behavior: grpcurl shows headers even in case there is an unexpected status code (and possibly no content).

$ grpcurl -vv -plaintext         -d '<redacted>' -H "Authorization: Bearer $TOKEN"         [::1]:8000 <redacted>

Resolved method descriptor:
<redacted>
Request metadata to send:
authorization: Bearer <redacted>
Response headers received:
(empty)

Response trailers received:
(empty)
Sent 1 request and received 0 responses
ERROR:
  Code: Unauthenticated
  Message: unexpected HTTP status code received from server: 401 (Unauthorized)

Wireshark: headers-present