Skip to content

Comments

transport: surface subsequent data when receiving non-gRPC header#8929

Open
chengxilo wants to merge 2 commits intogrpc:masterfrom
chengxilo:surface-response-body
Open

transport: surface subsequent data when receiving non-gRPC header#8929
chengxilo wants to merge 2 commits intogrpc:masterfrom
chengxilo:surface-response-body

Conversation

@chengxilo
Copy link

@chengxilo chengxilo commented Feb 22, 2026

Close #7406

If content-type is not grpc, we read the next data frames till 1kb or endStream, and append the subsequent data to error message.

Example:

When receiving

[header]
":status", "200",
"content-type", "text/html",

[payload]
<html><body>Hello World</body></html>

Return

rpc error: code = Unknown desc = unexpected HTTP status code received from server: 200 (OK); transport: received unexpected content-type "text/html"
data: "<html><body>Hello World</body></html>"`,

RELEASE NOTES:

  • Surface data when receiving non-gRPC header, append it to the error message with this formet [error]\n data: "[data]"

@chengxilo chengxilo force-pushed the surface-response-body branch from d42d1a5 to 3dc8573 Compare February 22, 2026 21:53
@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 84.48276% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.21%. Comparing base (19e4128) to head (3cd1bf5).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
internal/transport/http2_client.go 82.75% 4 Missing and 1 partial ⚠️
internal/transport/client_stream.go 86.20% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8929      +/-   ##
==========================================
- Coverage   83.30%   83.21%   -0.09%     
==========================================
  Files         417      417              
  Lines       32940    32996      +56     
==========================================
+ Hits        27442    27459      +17     
- Misses       4082     4108      +26     
- Partials     1416     1429      +13     
Files with missing lines Coverage Δ
internal/transport/client_stream.go 94.59% <86.20%> (-5.41%) ⬇️
internal/transport/http2_client.go 92.36% <82.75%> (-0.29%) ⬇️

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chengxilo chengxilo changed the title feat: surface response data when receiving an unexpected status code … feat: surface subsequent data when receiving non-gRPC header Feb 22, 2026
@chengxilo chengxilo changed the title feat: surface subsequent data when receiving non-gRPC header transport: surface subsequent data when receiving non-gRPC header Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Surface response body when receiving an unexpected status code and content-type

1 participant