-
Notifications
You must be signed in to change notification settings - Fork 36
Change user agent to javascript-client #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR standardizes the User-Agent header prefix to javascript-client across both REST and gRPC clients.
- Changed REST client header from
qdrant-js/<version>tojavascript-client/<version> - Changed gRPC client interceptor header from
qdrant-js/<version>tojavascript-client/<version>
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/js-client-rest/src/qdrant-client.ts | Updated user-agent header to javascript-client/<version> |
| packages/js-client-grpc/src/api-client.ts | Modified gRPC interceptor to set user-agent to javascript-client/<version> |
Comments suppressed due to low confidence (2)
packages/js-client-rest/src/qdrant-client.ts:97
- Add a unit test to verify that the REST client sets the
user-agentheader tojavascript-client/<PACKAGE_VERSION>, ensuring future changes don't break this behavior.
const headers = new Headers([['user-agent', 'javascript-client/' + String(PACKAGE_VERSION)]]);
packages/js-client-grpc/src/api-client.ts:55
- Add a test for the gRPC interceptor to confirm that the
user-agentheader is correctly set tojavascript-client/<PACKAGE_VERSION>on every request.
req.header.set('user-agent', 'javascript-client/' + String(PACKAGE_VERSION));
| } | ||
|
|
||
| const headers = new Headers([['user-agent', 'qdrant-js/' + String(PACKAGE_VERSION)]]); | ||
| const headers = new Headers([['user-agent', 'javascript-client/' + String(PACKAGE_VERSION)]]); |
Copilot
AI
Jun 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider extracting the 'javascript-client/' + String(PACKAGE_VERSION) value into a shared constant to avoid duplication between REST and gRPC clients.
| const headers = new Headers([['user-agent', 'javascript-client/' + String(PACKAGE_VERSION)]]); | |
| const headers = new Headers([['user-agent', USER_AGENT]]); |
| const interceptors: Interceptor[] = [ | ||
| (next) => (req) => { | ||
| req.header.set('user-agent', 'qdrant-js/' + String(PACKAGE_VERSION)); | ||
| req.header.set('user-agent', 'javascript-client/' + String(PACKAGE_VERSION)); |
Copilot
AI
Jun 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider moving the user-agent string construction into a shared utility or constant to keep the REST and gRPC implementations consistent and DRY.
| req.header.set('user-agent', 'javascript-client/' + String(PACKAGE_VERSION)); | |
| req.header.set('user-agent', getUserAgent()); |
Bumps #89
Following the same reasoning as qdrant/qdrant-client#1028