()
| 517 | |
| 518 | #[tokio::test] |
| 519 | async fn content_encoding_header() { |
| 520 | // Drive the implementation by using `hyper::Body` instead of |
| 521 | // of `aws_lambda_events::encodings::Body` |
| 522 | let response = Response::builder() |
| 523 | .header(CONTENT_ENCODING, "gzip") |
| 524 | .body(HyperBody::from("000000".as_bytes())) |
| 525 | .expect("unable to build http::Response"); |
| 526 | let response = response.into_response().await; |
| 527 | let response = LambdaResponse::from_response(&RequestOrigin::ApiGatewayV2, response); |
| 528 | |
| 529 | let json = serde_json::to_string(&response).expect("failed to serialize to json"); |
| 530 | assert_eq!( |
| 531 | json, |
| 532 | r#"{"statusCode":200,"headers":{"content-encoding":"gzip"},"multiValueHeaders":{},"body":"MDAwMDAw","isBase64Encoded":true,"cookies":[]}"# |
| 533 | ) |
| 534 | } |
| 535 | |
| 536 | #[tokio::test] |
| 537 | async fn content_type_header() { |
nothing calls this directly
no test coverage detected