From 59e2cbff7bce014209813369d2a33a25ac193bb3 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 14 Jun 2023 10:20:47 -0400 Subject: [PATCH] fix(http_client source): remove utf8 lossy conversion (#17655) Fixes: https://github.com/vectordotdev/vector/issues/16814 This change is a now a no-op thanks to https://github.com/vectordotdev/vector/pull/17628 and https://github.com/vectordotdev/vector/pull/17688. --- 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 0b8ba25dace35..6ba6ea77220f1 100644 --- a/src/sources/http_client/client.rs +++ b/src/sources/http_client/client.rs @@ -309,8 +309,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);