Skip to content

Commit 1596af1

Browse files
authored
fix gl-js header (#8198)
1 parent 3d11ecc commit 1596af1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/vertexai/src/requests/request.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ describe('request methods', () => {
112112
);
113113
it('adds client headers', async () => {
114114
const headers = await getHeaders(fakeUrl);
115-
expect(headers.get('x-goog-api-client')).to.include('gl-js/ fire/');
115+
expect(headers.get('x-goog-api-client')).to.match(
116+
/gl-js\/[0-9\.]+ fire\/[0-9\.]+/
117+
);
116118
});
117119
it('adds api key', async () => {
118120
const headers = await getHeaders(fakeUrl);

packages/vertexai/src/requests/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class RequestUrl {
7171
*/
7272
function getClientHeaders(): string {
7373
const loggingTags = [];
74-
loggingTags.push(`${LANGUAGE_TAG}/`);
74+
loggingTags.push(`${LANGUAGE_TAG}/${PACKAGE_VERSION}`);
7575
loggingTags.push(`fire/${PACKAGE_VERSION}`);
7676
return loggingTags.join(' ');
7777
}

0 commit comments

Comments
 (0)