From b0fcb728e110c35c80038d6827151449f73259e4 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Fri, 9 Jun 2023 12:17:59 -0400 Subject: [PATCH] fix(http_client source): remove utf8 lossy conversion --- src/sources/http_client/client.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sources/http_client/client.rs b/src/sources/http_client/client.rs index 6732a4975aad7..300ef034e48fa 100644 --- a/src/sources/http_client/client.rs +++ b/src/sources/http_client/client.rs @@ -307,8 +307,7 @@ impl http_client::HttpClientContext for HttpClientContext { fn on_response(&mut self, _url: &Uri, _header: &Parts, body: &Bytes) -> Option> { // get the body into a byte array let mut buf = BytesMut::new(); - let body = String::from_utf8_lossy(body); - buf.extend_from_slice(body.as_bytes()); + buf.extend_from_slice(body); let events = self.decode_events(&mut buf);