diff --git a/ext/include/opentelemetry/ext/http/common/url_parser.h b/ext/include/opentelemetry/ext/http/common/url_parser.h index 2ac6d00af8..636546bba5 100644 --- a/ext/include/opentelemetry/ext/http/common/url_parser.h +++ b/ext/include/opentelemetry/ext/http/common/url_parser.h @@ -83,7 +83,7 @@ class UrlParser pos = url_.find_first_of("/?", cpos); if (pos == std::string::npos) { - path_ = "/"; // use default path + path_ = std::string("/"); // use default path if (is_port) { port_ = static_cast( @@ -122,7 +122,7 @@ class UrlParser } return; } - path_ = "/"; + path_ = std::string("/"); if (url_[cpos] == '?') { query_ = std::string(url_.begin() + cpos, url_.begin() + url_.length());