Skip to content

Commit

Permalink
Fixed port handling so it returns the correct port and not only 6663
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxBurner committed Jan 4, 2024
1 parent 609ae87 commit 2355cb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/components/nodes/vectorstores/Qdrant/Qdrant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,18 @@ class Qdrant_VectorStores implements INode {
* @param qdrantServerUrl the url to get the port from
*/
static determinePortByUrl(qdrantServerUrl: string) :number {
let port = 6333;
const parsedUrl = new URL(qdrantServerUrl);

let port = parsedUrl.port ? parseInt(parsedUrl.port) : 6663

if (parsedUrl.protocol === 'https:' && parsedUrl.port === '') {
port = 443;
}
if (parsedUrl.protocol === 'http:' && parsedUrl.port === '') {
port = 80;
}


return port;
}
}
Expand Down

0 comments on commit 2355cb2

Please sign in to comment.