Skip to content

Commit

Permalink
fix(pubsub): set x-goog-request-params for streaming pull request (#8753
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kamalaboulhosn committed Oct 31, 2023
1 parent fe1e195 commit 21ec815
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pubsub/pullstream.go
Expand Up @@ -16,7 +16,9 @@ package pubsub

import (
"context"
"fmt"
"io"
"net/url"
"sync"
"time"

Expand All @@ -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,
Expand Down

0 comments on commit 21ec815

Please sign in to comment.