Skip to content

Commit 6c07132

Browse files
committed
Minor touchup to remove trailing newline
1 parent b2e4069 commit 6c07132

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/src/http/client/curl/http_operation_curl.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,9 @@ int HttpOperation::CurlLoggerCallback(const CURL * /* handle */,
578578
{
579579
nostd::string_view text_to_log{data, size};
580580

581-
if (text_to_log.empty() || std::iscntrl(text_to_log[0]))
581+
if (!text_to_log.empty() && text_to_log[size - 1] == '\n')
582582
{
583-
return 0;
583+
text_to_log = text_to_log.substr(0, size - 1);
584584
}
585585

586586
if (type == CURLINFO_TEXT)
@@ -614,7 +614,7 @@ int HttpOperation::CurlLoggerCallback(const CURL * /* handle */,
614614

615615
if (pos != nostd::string_view::npos)
616616
{
617-
OTEL_INTERNAL_LOG_DEBUG(kHeaderSent << text_to_log.substr(0, pos));
617+
OTEL_INTERNAL_LOG_DEBUG(kHeaderSent << text_to_log.substr(0, pos - 1));
618618
text_to_log = text_to_log.substr(pos + 1);
619619
}
620620
}

0 commit comments

Comments
 (0)