Skip to content

QdrantClient doesn't set _prefix when parsing from url #104

@CW-B-W

Description

@CW-B-W

In

} else if (url) {
if (!(url.startsWith('http://') || url.startsWith('https://'))) {
throw new QdrantClientConfigError(
'The `url` param expected to contain a valid URL starting with a protocol (http:// or https://).',
);
}
const parsedUrl = new URL(url);
this._host = parsedUrl.hostname;
this._port = parsedUrl.port ? Number(parsedUrl.port) : port;
this._scheme = parsedUrl.protocol.replace(':', '');
if (this._prefix.length > 0 && parsedUrl.pathname !== '/') {
throw new QdrantClientConfigError(
'Prefix can be set either in `url` or in `prefix`.\n' +
`url is ${url}, prefix is ${parsedUrl.pathname}`,
);
}
} else {

this._prefix is never set with parsedUrl.pathname.

Consequently, when the argument url has prefix, the prefix will not be passed to

this._restUri = `${this._scheme}://${address}${this._prefix}`;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions