Skip to content

Commit ada6146

Browse files
authored
Merge pull request mtconnect#494 from mtconnect/493_improve_source_url_handling
2 parents 7c9e87c + a269ca7 commit ada6146

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/mtconnect/configuration/agent_config.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,15 @@ namespace mtconnect::configuration {
911911

912912
auto parsed = Url::parse(url);
913913
options[configuration::Protocol] = parsed.m_protocol;
914-
options[configuration::Host] = parsed.getHost();
914+
915+
auto host = parsed.getHost();
916+
if (host.empty())
917+
{
918+
LOG(fatal) << "Malformed URL in configuration file: '" << url << "', exiting";
919+
exit(1);
920+
}
921+
options[configuration::Host] = host;
922+
915923
if (parsed.m_port)
916924
options[configuration::Port] = parsed.getPort();
917925
if (parsed.m_path != "/")

0 commit comments

Comments
 (0)