fullstorydev / fullstorydev/grpcurl

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

Open
#430 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
12.8k
Forks
580
Avg merge
1h 8m
Merged PRs (30d)
5

Description

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 '' -H "Authorization: Bearer $TOKEN" [::1]:8000

Resolved method descriptor:

Request metadata to send:
authorization: Bearer
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](https://github.com/fullstorydev/grpcurl/assets/26125115/23696356-9212-4ad3-9f1b-a9ad2d0024a5)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the grpcurl command with -vv and an unexpected 401 response, then trace the code path that formats response headers when no response message is received. Done means present HTTP response headers are displayed instead of “(empty)” while trailers and the Unauthenticated error remain correctly reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.