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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user