-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
private parseQdrantUrl(url: string | undefined): string { | ||
// Handle undefined/null/empty cases | ||
if (!url || url.trim() === "") { | ||
return "http://localhost:6333" |
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
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! |
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!
Related GitHub Issue
Closes: #4991
Description
Fixed QdrantVectorStore URL parsing logic that incorrectly appended
:6333
to HTTPS URLs.Key implementation changes:
parseQdrantUrl()
method with protocol-aware port handling:6333
appendedparseHostname()
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'
):6333
appended 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
QdrantVectorStore
to correctly handle HTTPS URLs without appending default port:6333
.QdrantVectorStore
to prevent appending:6333
to HTTPS URLs without explicit ports.parseQdrantUrl()
inqdrant-client.ts
for protocol-aware port handling.:6333
appended; HTTPS URLs default to port 443.parseHostname()
for hostname-only inputs.qdrant-client.spec.ts
for various URL formats and edge cases.This description was created by
for fee98ec. You can customize this summary. It will automatically update as commits are pushed.