-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(qdrant): resolve URL port handling bug for HTTPS URLs #4992
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
fix(qdrant): resolve URL port handling bug for HTTPS URLs #4992
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.
Hardcoded default port (6333) is used in multiple places. Consider defining this as a constant for better maintainability.
4fc728c to
813698a
Compare
mrubens
left a comment
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.
LGTM if @daniel-lxs agrees!
813698a to
be3a84c
Compare
|
Sorry I made a few more changes. Should be good now. |
|
Hello @benashby, Would you also use parameter I use Nginx as reverse proxy to connect my Qdrant service, the url used was like (Also QdrantClient doesn't properly set the Would you refer to my version of fix main...CW-B-W:Roo-Code:fix_qdrant_connection . Thanks! |
daniel-lxs
left a comment
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.
Looks good!
Thank you @benashby!
Co-authored-by: Ben Ashby <[email protected]>
…#4992) Co-authored-by: Ben Ashby <[email protected]>
…#4992) Co-authored-by: Ben Ashby <[email protected]>
Related GitHub Issue
Closes: #4991
Description
Fixed QdrantVectorStore URL parsing logic that incorrectly appended
:6333to HTTPS URLs.Key implementation changes:
parseQdrantUrl()method with protocol-aware port handling:6333appendedparseHostname()helper for hostname-only inputsDesign choice: Used JavaScript's built-in URL constructor for robust parsing with fallback to hostname detection for malformed inputs.
Test Procedure
Unit Tests: 46 comprehensive tests covering all URL formats:
Manual Testing:
'https://qdrant.example.com''https://qdrant.example.com'(not'https://qdrant.example.com:6333'):6333appended correctlyPre-Submission Checklist
Documentation Updates
Additional Notes
All tests pass, ESLint clean. Fix is backward compatible and handles edge cases including IP addresses, custom ports, and malformed URLs.
Important
Fixes URL parsing in
QdrantVectorStoreto correctly handle HTTPS URLs without appending default port:6333.QdrantVectorStoreto prevent appending:6333to HTTPS URLs without explicit ports.parseQdrantUrl()inqdrant-client.tsfor protocol-aware port handling.:6333appended; HTTPS URLs default to port 443.parseHostname()for hostname-only inputs.qdrant-client.spec.tsfor various URL formats and edge cases.This description was created by
for fee98ec1ed72b70eaeead908bebd68433cdf6812. You can customize this summary. It will automatically update as commits are pushed.