Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ hostname = { version = "0.4.0", default-features = false }
http = { version = "0.2.9", default-features = false }
http-1 = { package = "http", version = "1.0", default-features = false, features = ["std"] }
http-serde = "1.1.3"
http-body = { version = "0.4.5", default-features = false }
http-body = { version = "0.4.6", default-features = false }
humantime.workspace = true
hyper = { version = "0.14.28", default-features = false, features = ["client", "runtime", "http1", "http2", "server", "stream"] }
hyper = { version = "0.14.32", default-features = false, features = ["client", "runtime", "http1", "http2", "server", "stream", "backports", "deprecated"] }
hyper-openssl = { version = "0.9.2", default-features = false }
hyper-proxy = { version = "0.9.1", default-features = false, features = ["openssl-tls"] }
indexmap.workspace = true
Expand Down
2 changes: 2 additions & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -886,12 +886,14 @@ windows-future,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The win
windows-implement,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows-interface,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows-link,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows-link,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-link Authors
windows-numerics,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-numerics Authors
windows-registry,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows-result,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows-service,https://github.com/mullvad/windows-service-rs,MIT OR Apache-2.0,Mullvad VPN
windows-strings,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows-sys,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows-sys,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-sys Authors
windows-targets,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows_aarch64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows_aarch64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
Expand Down
3 changes: 2 additions & 1 deletion src/components/validation/resources/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use axum::{
};
use bytes::{BufMut as _, BytesMut};
use http::{Method, Request, StatusCode, Uri};
use http_body::{Body as _, Collected};
use hyper::{Body, Client, Server};
use tokio::{
select,
Expand Down Expand Up @@ -328,7 +329,7 @@ impl HttpResourceOutputContext<'_> {
let mut decoder = decoder.clone();

async move {
match hyper::body::to_bytes(request.into_body()).await {
match request.into_body().collect().await.map(Collected::to_bytes) {
Err(_) => StatusCode::INTERNAL_SERVER_ERROR.into_response(),
Ok(body) => {
let byte_size = body.len();
Expand Down
5 changes: 4 additions & 1 deletion src/gcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use goauth::{
credentials::Credentials,
};
use http::{Uri, uri::PathAndQuery};
use http_body::{Body as _, Collected};
use hyper::header::AUTHORIZATION;
use smpl_jwt::Jwt;
use snafu::{ResultExt, Snafu};
Expand Down Expand Up @@ -296,8 +297,10 @@ async fn get_token_implicit() -> Result<Token, GcpError> {
.context(GetImplicitTokenSnafu)?;

let body = res.into_body();
let bytes = hyper::body::to_bytes(body)
let bytes = body
.collect()
.await
.map(Collected::to_bytes)
.context(GetTokenBytesSnafu)?;

// Token::from_str is irresponsible and may panic!
Expand Down
6 changes: 5 additions & 1 deletion src/providers/http.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use async_stream::stream;
use bytes::Buf;
use futures::Stream;
use http_body::{Body as _, Collected};
use hyper::Body;
use indexmap::IndexMap;
use tokio::time;
Expand Down Expand Up @@ -111,8 +112,11 @@ async fn http_request(

info!(message = "Response received.", url = ?url.as_str());

hyper::body::to_bytes(response.into_body())
response
.into_body()
.collect()
.await
.map(Collected::to_bytes)
.map_err(|err| {
let message = "Error interpreting response.";
let cause = err.into_cause();
Expand Down
3 changes: 1 addition & 2 deletions src/sinks/azure_monitor_logs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::time::Duration;

use futures::{future::ready, stream};
use http::Response;
use hyper::body;
use openssl::{base64, hash, pkey, sign};
use tokio::time::timeout;
use vector_lib::config::log_schema;
Expand Down Expand Up @@ -205,7 +204,7 @@ async fn correct_request() {
let (parts, body) = request.into_parts();
assert_eq!(&parts.method.to_string(), "POST");

let body = body::to_bytes(body).await.unwrap();
let body = http_body::Body::collect(body).await.unwrap().to_bytes();
let json: serde_json::Value = serde_json::from_slice(&body[..]).unwrap();
let expected_json = serde_json::json!([
{
Expand Down
8 changes: 6 additions & 2 deletions src/sinks/datadog/traces/apm_stats/integration_tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::{collections::HashMap, io::Read, net::SocketAddr, sync::Arc};

use http_body::Body as _;

use axum::{
Router,
body::Body,
Expand Down Expand Up @@ -122,9 +124,11 @@ async fn process_stats(Extension(state): Extension<Arc<AppState>>, mut request:
debug!("`{}` server got stats payload.", state.name);

let body = request.body_mut();
let compressed_body_bytes = hyper::body::to_bytes(body)
let compressed_body_bytes = body
.collect()
.await
.expect("could not decode body into bytes");
.expect("could not decode body into bytes")
.to_bytes();

let mut gz = GzDecoder::new(compressed_body_bytes.as_ref());
let mut decompressed_body_bytes = vec![];
Expand Down
5 changes: 4 additions & 1 deletion src/sinks/datadog/traces/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::{
use bytes::{Buf, Bytes};
use futures::future::BoxFuture;
use http::{Request, StatusCode, Uri};
use http_body::{Body as _, Collected};
use hyper::Body;
use snafu::ResultExt;
use tower::Service;
Expand Down Expand Up @@ -156,8 +157,10 @@ impl Service<TraceApiRequest> for TraceApiService {

let response = client.send(http_request).await?;
let (parts, body) = response.into_parts();
let mut body = hyper::body::aggregate(body)
let mut body = body
.collect()
.await
.map(Collected::aggregate)
.context(CallRequestSnafu)?;
let body = body.copy_to_bytes(body.remaining());

Expand Down
Loading
Loading