Skip to content

Commit

Permalink
Upgrade lambda-http crate to 0.9.3 (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnusunny authored Feb 14, 2024
1 parent 42eada5 commit 28ad1ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ http = "1.0"
http-body = "1.0.0"
hyper = { version = "1.0", features = ["client"] }
hyper-util = "0.1.2"
lambda_http = { version = "0.9.2", default-features = false, features = ["apigw_http", "apigw_rest", "alb", "pass_through"] }
lambda_http = { version = "0.9.3", default-features = false, features = ["apigw_http", "apigw_rest", "alb", "pass_through"] }
serde_json = "1.0"
tokio = { version = "1.35", features = [
"macros",
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use http::{
header::{HeaderName, HeaderValue},
Method, StatusCode,
};
use http_body::Body as HttpBody;
use hyper::body::Incoming;
use hyper_util::client::legacy::connect::HttpConnector;
use hyper_util::client::legacy::Client;
Expand Down Expand Up @@ -294,7 +295,7 @@ impl Adapter<HttpConnector, Body> {
path = path.trim_start_matches(base_path);
}

if let RequestContext::PassThrough = request_context {
if matches!(request_context, RequestContext::PassThrough) && parts.method == Method::POST {
path = self.path_through_path.as_str();
}

Expand Down Expand Up @@ -325,6 +326,8 @@ impl Adapter<HttpConnector, Body> {
let request = builder.body(Body::from(body.to_vec()))?;

let app_response = self.client.request(request).await?;
tracing::debug!(status = %app_response.status(), body_size = ?app_response.body().size_hint().lower(),
app_headers = ?app_response.headers().clone(), "responding to lambda event");

Ok(app_response)
}
Expand Down

0 comments on commit 28ad1ca

Please sign in to comment.