Skip to content

Commit 51d0f6d

Browse files
pablomartinezbernardoduncanista
authored andcommitted
extract_request_body before exiting handle_end_invocation
1 parent cd9d1bb commit 51d0f6d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

bottlecap/src/lifecycle/listener.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ impl Listener {
168168
State((invocation_processor_handle, _, tasks)): State<ListenerState>,
169169
request: Request,
170170
) -> Response {
171+
let (parts, body) = match extract_request_body(request).await {
172+
Ok(r) => r,
173+
Err(e) => {
174+
error!("Failed to extract request body: {e}");
175+
return (StatusCode::OK, json!({}).to_string()).into_response();
176+
}
177+
};
178+
171179
let mut join_set = tasks.lock().await;
172180
join_set.spawn(async move {
173-
let (parts, body) = match extract_request_body(request).await {
174-
Ok(r) => r,
175-
Err(e) => {
176-
error!("Failed to extract request body: {e}");
177-
return;
178-
}
179-
};
180-
181181
Self::universal_instrumentation_end(&parts.headers, body, invocation_processor_handle)
182182
.await;
183183
});

0 commit comments

Comments
 (0)