From 21ec8158d9e3c14082f76a75f182c98253b4273b Mon Sep 17 00:00:00 2001 From: Kamal Aboul-Hosn Date: Tue, 31 Oct 2023 10:30:51 -0400 Subject: [PATCH] fix(pubsub): set x-goog-request-params for streaming pull request (#8753) --- pubsub/pullstream.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pubsub/pullstream.go b/pubsub/pullstream.go index d6f5eb636e5c..bfdc11e2a02e 100644 --- a/pubsub/pullstream.go +++ b/pubsub/pullstream.go @@ -16,7 +16,9 @@ package pubsub import ( "context" + "fmt" "io" + "net/url" "sync" "time" @@ -42,6 +44,8 @@ type streamingPullFunc func(context.Context, ...gax.CallOption) (pb.Subscriber_S func newPullStream(ctx context.Context, streamingPull streamingPullFunc, subName string, maxOutstandingMessages, maxOutstandingBytes int, maxDurationPerLeaseExtension time.Duration) *pullStream { ctx = withSubscriptionKey(ctx, subName) + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "subscription", url.QueryEscape(subName))} + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) ctx, cancel := context.WithCancel(ctx) return &pullStream{ ctx: ctx,