MCPcopy Index your code
hub / github.com/aws/aws-lambda-rust-runtime / content_encoding_header

Function content_encoding_header

lambda-http/src/response.rs:519–534  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

into_responseMethod · 0.45

Tested by

no test coverage detected