fix: clone accept header before moving request

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-28 17:33:16 -03:00
parent 2e20f74675
commit 78cc39fbd2

View File

@@ -213,11 +213,12 @@ pub async fn logging_middleware(
let method = request.method().clone(); let method = request.method().clone();
let uri = request.uri().clone(); let uri = request.uri().clone();
// Log the Accept header // Log the Accept header - extract before moving the request
let accept_header = request.headers() let accept_header = request.headers()
.get("accept") .get("accept")
.and_then(|v| v.to_str().ok()) .and_then(|v| v.to_str().ok())
.unwrap_or("-"); .unwrap_or("-")
.to_string();
let start = Instant::now(); let start = Instant::now();
let response = next.run(request).await; let response = next.run(request).await;