Server: response-metadata echo is only tested with x-custom-* names, so reserved names go unchecked
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- grpc, yaml
- Domain
- api, testing-qa
Research direction
Review duplicate_metadata.yaml and the server-mode cases under testsuites/*.yaml, then trace how responseHeaders and responseTrailers are interpreted. First resolve which behavior is conformant for reserved names; once decided, add cases for content-type, content-length, content-encoding, and trailers while preserving the multi-valued custom-header coverage. Done means the suite pins the chosen behavior without a harness change.
Written by the indexing model from the issue text.
Description
Summary
Server-mode tests only ever ask the server under test to echo two metadata names, x-custom-header and x-custom-trailer. Nothing exercises a name that collides with one the server sets itself, or a name that describes the transport rather than the payload. One such name makes a server emit a response a real client cannot read at all, and the suite does not notice.
The coverage
Collecting every name under responseHeaders or responseTrailers across all of testsuites/*.yaml:
64 x-custom-trailer
58 x-custom-header
That is the complete set. So no case covers either of:
- a name the server also sets for itself —
content-typebeing the obvious one; - a name scoped to the transport rather than the response payload —
content-length,content-encoding,transfer-encoding,connection,date,grpc-encoding.
Both are ordinary in practice, because the natural way to write a gateway is to propagate an upstream error's metadata onto the response, and an upstream error's metadata contains exactly these names.
What that permits
Measured against connect-go v1.19.1 and grpc-go v1.81.1, driving a server that echoes an upstream error's header block onto its own error response, with a per-header bisect to isolate each name.
content-length is not survivable. A server that emits an echoed content-length: 4096 on a Connect error over HTTP/1.1 produces a response the HTTP/1 layer refuses to serialize — in our case the connection closed with zero bytes written. connect-go reports unexpected EOF with empty metadata. The handler's actual error code never reaches the client: a permission_denied arrived as unavailable, and every other code collapses the same way, because all the client ever observes is a transport failure.
The others are milder but real:
- an echoed
content-encoding: gzipmakes connect-go attempt to gunzip a plain-JSON error body, discard it, and fall back to the HTTP status — losing the error code and message; - an echoed
content-typeis appended rather than replacing, so twocontent-typevalues reach the wire (both Go clients tolerate this, but it is malformed); - an echoed
datedisplaces the one the server would otherwise set, so the response advertises a false generation time.
We shipped all of the above in connectrpc/connect-rust while passing server conformance 3600/0, Connect+TLS 2396/0, and all three client suites. duplicate_metadata.yaml was the closest existing case — it echoes multi-valued x-custom-header onto error responses across all four RPC kinds — but because the name is a custom one, it cannot catch any of this.
The question this is really asking
Unlike the sibling issues, this one is not "the implementations disagree, please pick". It is that the suite does not say what a conformant server should do when asked to echo a reserved name, and there are at least three defensible answers:
- Drop them. What we settled on: the response's own header wins, and transport-scoped names are not forwarded.
- Forward them verbatim. Defensible in principle, but
content-lengthdemonstrably yields an unreadable response, so this cannot be right for at least that name. - Reject the RPC. Treat it as a handler error.
Whichever it is, pinning it would be worth doing, because the failure mode for getting it wrong is not a wrong error code — it is a response the peer cannot parse.
Suggested cases
Server-mode, expressible as test data with no harness change, since responseHeaders/responseTrailers already accept arbitrary names:
responseHeaderscontainingcontent-typeset to something other than what the protocol requires. Assert exactly onecontent-typereaches the wire, and that it is the protocol's.responseHeaderscontainingcontent-lengthwith a value that does not match the body, on Connect over HTTP/1.1 specifically — the combination that produced the unserializable response.responseHeaderscontainingcontent-encoding: gzipon an uncompressed error body.- A multi-valued custom name alongside the above, asserting both values still arrive — so that whatever filtering an implementation adds cannot over-reach. This is the regression guard for anyone implementing (1).
- The same set under
responseTrailers, which is the same question one frame later.
Happy to send a PR once there is a decision on which of the three behaviours is conformant. If it helps, we can also contribute the interop harness we used for the bisect.
- Dominant language
- Go
- Stars
- 96
- Forks
- 22
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from connectrpc/conformance
-
Reformat test names for single-protocol tests to start with Protocol/, i.e. gRPC/ or Websocket/Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
connectrpc/conformance#1211 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
connectrpc/conformance#1120 ·
Maintainers usually reply within 1 day
-
Test that clients reject malformed response messagesPossibly taken @stefanvanburen claimed this 23 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
connectrpc/conformance#1190 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
connectrpc/conformance#1146 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
connectrpc/conformance#1143 · 1 comment ·
Maintainers usually reply within 1 day
All issues in connectrpc/conformance
Similar issues
-
BasicEventElement `messageBroker` is never returned on read (jsonb decoded into `sql.NullString`)Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
eclipse-basyx/basyx-go-components#963 ·
Maintainers usually reply within 1 day
-
Area/Console Aspect/UI Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
wso2/agent-manager#2743 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day