Skip to content

Commit a0f6828

Browse files
authored
Release 0.7.0 (#546)
Ensure that we don't print internal warnings on user applications. Signed-off-by: David Calavera <david.calavera@gmail.com> Signed-off-by: David Calavera <david.calavera@gmail.com>
1 parent 1e16502 commit a0f6828

File tree

7 files changed

+23
-19
lines changed

7 files changed

+23
-19
lines changed

lambda-extension/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lambda-extension"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
edition = "2021"
55
authors = [
66
"David Calavera <dcalaver@amazon.com>",
@@ -19,7 +19,7 @@ bytes = "1.0"
1919
chrono = { version = "0.4", features = ["serde"] }
2020
http = "0.2"
2121
hyper = { version = "0.14.20", features = ["http1", "client", "server", "stream", "runtime"] }
22-
lambda_runtime_api_client = { version = "0.6", path = "../lambda-runtime-api-client" }
22+
lambda_runtime_api_client = { version = "0.7", path = "../lambda-runtime-api-client" }
2323
serde = { version = "1", features = ["derive"] }
2424
serde_json = "^1"
2525
tracing = { version = "0.1", features = ["log"] }

lambda-http/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lambda_http"
3-
version = "0.6.2"
3+
version = "0.7.0"
44
authors = [
55
"David Calavera <dcalaver@amazon.com>",
66
"Harold Sun <sunhua@amazon.com>"
@@ -28,7 +28,7 @@ bytes = "1"
2828
http = "0.2"
2929
http-body = "0.4"
3030
hyper = "0.14.20"
31-
lambda_runtime = { path = "../lambda-runtime", version = "0.6" }
31+
lambda_runtime = { path = "../lambda-runtime", version = "0.7" }
3232
serde = { version = "^1", features = ["derive"] }
3333
serde_json = "^1"
3434
serde_urlencoded = "0.7.0"

lambda-http/src/request.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
//! Typically these are exposed via the `request_context`
44
//! request extension method provided by [lambda_http::RequestExt](../trait.RequestExt.html)
55
//!
6-
use crate::ext::{PathParameters, QueryStringParameters, RawHttpPath, StageVariables};
6+
#[cfg(any(feature = "apigw_rest", feature = "apigw_http", feature = "apigw_websockets"))]
7+
use crate::ext::{PathParameters, StageVariables};
8+
use crate::ext::{QueryStringParameters, RawHttpPath};
79
#[cfg(feature = "alb")]
810
use aws_lambda_events::alb::{AlbTargetGroupRequest, AlbTargetGroupRequestContext};
911
#[cfg(feature = "apigw_rest")]
@@ -19,7 +21,6 @@ use serde::Deserialize;
1921
use serde_json::error::Error as JsonError;
2022
use std::future::Future;
2123
use std::pin::Pin;
22-
use std::str::FromStr;
2324
use std::{io::Read, mem};
2425
use url::Url;
2526

@@ -246,7 +247,10 @@ fn into_alb_request(alb: AlbTargetGroupRequest) -> http::Request<Body> {
246247
req
247248
}
248249

250+
#[cfg(feature = "alb")]
249251
fn decode_query_map(query_map: QueryMap) -> QueryMap {
252+
use std::str::FromStr;
253+
250254
let query_string = query_map.to_query_string();
251255
let decoded = percent_encoding::percent_decode(query_string.as_bytes()).decode_utf8_lossy();
252256
QueryMap::from_str(&decoded).unwrap_or_default()
@@ -304,6 +308,7 @@ fn into_websocket_request(ag: ApiGatewayWebsocketProxyRequest) -> http::Request<
304308
req
305309
}
306310

311+
#[cfg(any(feature = "apigw_rest", feature = "apigw_http", feature = "apigw_websockets"))]
307312
fn apigw_path_with_stage(stage: &Option<String>, path: &str) -> String {
308313
match stage {
309314
None => path.into(),

lambda-http/src/response.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ use aws_lambda_events::encodings::Body;
1111
use encoding_rs::Encoding;
1212
use http::header::CONTENT_ENCODING;
1313
use http::HeaderMap;
14-
use http::{
15-
header::{CONTENT_TYPE, SET_COOKIE},
16-
Response,
17-
};
14+
use http::{header::CONTENT_TYPE, Response};
1815
use http_body::Body as HttpBody;
1916
use hyper::body::to_bytes;
2017
use mime::{Mime, CHARSET};
@@ -28,15 +25,15 @@ const X_LAMBDA_HTTP_CONTENT_ENCODING: &str = "x-lambda-http-content-encoding";
2825
// See list of common MIME types:
2926
// - https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
3027
// - https://github.com/ietf-wg-httpapi/mediatypes/blob/main/draft-ietf-httpapi-yaml-mediatypes.md
31-
const TEXT_ENCODING_PREFIXES: [&'static str; 5] = [
28+
const TEXT_ENCODING_PREFIXES: [&str; 5] = [
3229
"text",
3330
"application/json",
3431
"application/javascript",
3532
"application/xml",
3633
"application/yaml",
3734
];
3835

39-
const TEXT_ENCODING_SUFFIXES: [&'static str; 3] = ["+xml", "+yaml", "+json"];
36+
const TEXT_ENCODING_SUFFIXES: [&str; 3] = ["+xml", "+yaml", "+json"];
4037

4138
/// Representation of Lambda response
4239
#[doc(hidden)]
@@ -61,7 +58,7 @@ impl LambdaResponse {
6158
b @ Body::Binary(_) => (true, Some(b)),
6259
};
6360

64-
let mut headers = parts.headers;
61+
let headers = parts.headers;
6562
let status_code = parts.status.as_u16();
6663

6764
match request_origin {
@@ -75,6 +72,8 @@ impl LambdaResponse {
7572
}),
7673
#[cfg(feature = "apigw_http")]
7774
RequestOrigin::ApiGatewayV2 => {
75+
use http::header::SET_COOKIE;
76+
let mut headers = headers;
7877
// ApiGatewayV2 expects the set-cookies headers to be in the "cookies" attribute,
7978
// so remove them from the headers.
8079
let cookies = headers

lambda-integration-tests/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ readme = "../README.md"
1313
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1414

1515
[dependencies]
16-
lambda_http = { path = "../lambda-http", version = "0.6" }
17-
lambda_runtime = { path = "../lambda-runtime", version = "0.6" }
18-
lambda-extension = { path = "../lambda-extension", version = "0.6" }
16+
lambda_http = { path = "../lambda-http", version = "0.7" }
17+
lambda_runtime = { path = "../lambda-runtime", version = "0.7" }
18+
lambda-extension = { path = "../lambda-extension", version = "0.7" }
1919
serde = { version = "1", features = ["derive"] }
2020
tokio = { version = "1", features = ["full"] }
2121
tracing = { version = "0.1", features = ["log"] }

lambda-runtime-api-client/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lambda_runtime_api_client"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
edition = "2021"
55
authors = [
66
"David Calavera <dcalaver@amazon.com>",

lambda-runtime/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lambda_runtime"
3-
version = "0.6.1"
3+
version = "0.7.0"
44
authors = [
55
"David Calavera <dcalaver@amazon.com>",
66
"Harold Sun <sunhua@amazon.com>"
@@ -30,4 +30,4 @@ async-stream = "0.3"
3030
tracing = { version = "0.1", features = ["log"] }
3131
tower = { version = "0.4", features = ["util"] }
3232
tokio-stream = "0.1.2"
33-
lambda_runtime_api_client = { version = "0.6", path = "../lambda-runtime-api-client" }
33+
lambda_runtime_api_client = { version = "0.7", path = "../lambda-runtime-api-client" }

0 commit comments

Comments
 (0)