Skip to content

Do not send binary gRPC metadata on InvokeBinding calls - #1901

Merged
WhitWaldo merged 1 commit into
dapr:masterfrom
JoshVanL:fix/invoke-binding-binary-metadata
Aug 25, 2026
Merged

WhitWaldo merged 1 commit into
dapr:masterfrom
JoshVanL:fix/invoke-binding-binary-metadata

Conversation

@JoshVanL

Copy link
Copy Markdown
Contributor

Strip -bin suffixed gRPC metadata from InvokeBinding call options before sending. Trace context still propagates via the traceparent and tracestate text headers, and all other APIs keep sending grpc-trace-bin. This is a client-side mitigation for runtimes without the fix from dapr/dapr#10387.

Fixes #1897

Strip -bin suffixed gRPC metadata from InvokeBinding call options
before sending. Trace context still propagates via the traceparent and
tracestate text headers, and all other APIs keep sending
grpc-trace-bin. This is a client-side mitigation for runtimes without
the fix from dapr/dapr#10387.

Fixes dapr#1897

Signed-off-by: joshvanl <me@joshvanl.dev>
@JoshVanL
JoshVanL requested review from a team as code owners August 21, 2026 19:39

@WhitWaldo WhitWaldo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thank you!


for (var i = headers.Count - 1; i >= 0; i--)
{
if (headers[i].Key.EndsWith("-bin", StringComparison.OrdinalIgnoreCase))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoshVanL Should this look for endswith("bin") instead of "-bin" given the example here of "x-ms-meta-daprgrpctracebin"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WhitWaldo no I think keeping the -bin is correct:

https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md

Note that HTTP2 does not allow arbitrary octet sequences for header values so binary header values must be encoded using Base64 as per https://tools.ietf.org/html/rfc4648#section-4. Implementations MUST accept padded and un-padded values and should emit un-padded values. Applications define binary headers by having their names end with "-bin". Runtime libraries use this suffix to detect binary headers and properly apply base64 encoding & decoding as headers are sent and received.

x-ms-meta-daprgrpctracebin is not a proper gRPC binary header AFAIK

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.

Publish to servicebusqueue binding throws error invoking output binding <binding name>: (connlost): not a valid UTF-8 string

2 participants