From 7b82ff01e5c654b3e339dfdec5b3da8bf45da049 Mon Sep 17 00:00:00 2001 From: Kamal Aboul-Hosn Date: Fri, 3 Nov 2023 13:30:31 -0400 Subject: [PATCH] fix: set x-goog-request-params for streaming pull request (#1849) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * samples: create BigQuery subscription * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: set x-goog-request-params for streaming pull request --------- Co-authored-by: Owl Bot Co-authored-by: Megan Potter <57276408+feywind@users.noreply.github.com> --- src/message-stream.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/message-stream.ts b/src/message-stream.ts index 7ea275ee5..80b714496 100644 --- a/src/message-stream.ts +++ b/src/message-stream.ts @@ -323,8 +323,13 @@ export class MessageStream extends PassThrough { ? 0 : this._subscriber.maxBytes, }; + const otherArgs = { + headers: { + 'x-goog-request-params': 'subscription=' + this._subscriber.name, + }, + }; - const stream: PullStream = client.streamingPull({deadline}); + const stream: PullStream = client.streamingPull({deadline, otherArgs}); this._replaceStream(index, stream); stream.write(request); }