Skip to content

Commit 07b29db

Browse files
authored
bugfix: kafka schema registry URI was not properly constructed (#585)
1 parent 0f2265b commit 07b29db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Formats/KafkaSchemaRegistry.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ KafkaSchemaRegistry::KafkaSchemaRegistry(
2222
const String & certificate_file_,
2323
const String & ca_location_,
2424
bool skip_cert_check)
25-
: base_url(base_url_)
25+
: base_url(base_url_.ends_with("/") ? base_url_ : base_url_ + "/")
2626
, private_key_file(private_key_file_)
2727
, certificate_file(certificate_file_)
2828
, ca_location(ca_location_)
@@ -46,7 +46,8 @@ String KafkaSchemaRegistry::fetchSchema(UInt32 id)
4646
{
4747
try
4848
{
49-
Poco::URI url(base_url, std::format("/schemas/ids/{}", id));
49+
/// Do not use "/schemas/ids/{}" here, otherwise the `path` in `base_url` will be removed.
50+
Poco::URI url(base_url, std::format("schemas/ids/{}", id));
5051
LOG_TRACE(logger, "Fetching schema id = {}", id);
5152

5253
/// One second for connect/send/receive. Just in case.

0 commit comments

Comments
 (0)