Skip to content
Closed
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
20 changes: 12 additions & 8 deletions lambda-runtime/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,18 @@ impl TryFrom<HeaderMap> for Context {
.to_str()?
.parse()
.expect("Missing deadline"),
invoked_function_arn: headers["lambda-runtime-invoked-function-arn"]
.to_str()
.expect("Missing arn; this is a bug")
.to_owned(),
xray_trace_id: headers["lambda-runtime-trace-id"]
.to_str()
.expect("Invalid XRayTraceID sent by Lambda; this is a bug")
.to_owned(),
invoked_function_arn: headers
.get("lambda-runtime-invoked-function-arn")
.map(|h| h.to_str().expect("Invalid arn; this is a bug").to_owned())
.unwrap_or_default(),
xray_trace_id: headers
.get("lambda-runtime-trace-id")
.map(|h| {
h.to_str()
.expect("Invalid XRayTraceID sent by Lambda; this is a bug")
.to_owned()
})
.unwrap_or_default(),
..Default::default()
};
Ok(ctx)
Expand Down