mirror of
https://github.com/katanemo/plano.git
synced 2026-06-02 14:35:14 +02:00
ensure that request id is consistent (#677)
* ensure that request id is consistent * remove test debug/info statements
This commit is contained in:
parent
b45c7aba86
commit
57327ba667
9 changed files with 92 additions and 28 deletions
|
|
@ -157,7 +157,26 @@ async fn handle_agent_chat(
|
|||
.strip_prefix("/agents")
|
||||
.unwrap()
|
||||
.to_string();
|
||||
let request_headers = request.headers().clone();
|
||||
|
||||
let request_headers = {
|
||||
let mut headers = request.headers().clone();
|
||||
headers.remove(common::consts::ENVOY_ORIGINAL_PATH_HEADER);
|
||||
|
||||
if !headers.contains_key(common::consts::REQUEST_ID_HEADER) {
|
||||
let request_id = uuid::Uuid::new_v4().to_string();
|
||||
info!(
|
||||
"Request id not found in headers, generated new request id: {}",
|
||||
request_id
|
||||
);
|
||||
headers.insert(
|
||||
common::consts::REQUEST_ID_HEADER,
|
||||
hyper::header::HeaderValue::from_str(&request_id).unwrap(),
|
||||
);
|
||||
}
|
||||
|
||||
headers
|
||||
};
|
||||
|
||||
let chat_request_bytes = request.collect().await?.to_bytes();
|
||||
|
||||
debug!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue