mirror of
https://github.com/katanemo/plano.git
synced 2026-05-18 13:45:15 +02:00
Merge b85fab8696 into 22f332f62d
This commit is contained in:
commit
ca4a82533e
4 changed files with 22 additions and 0 deletions
|
|
@ -244,6 +244,14 @@ impl StreamContext {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn set_custom_provider_headers(&mut self) {
|
||||
if let Some(http_headers) = self.llm_provider().http_headers.clone() {
|
||||
for (key, value) in &http_headers {
|
||||
self.set_http_request_header(key.as_str(), Some(value.as_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn delete_content_length_header(&mut self) {
|
||||
// Remove the Content-Length header because further body manipulations in the gateway logic will invalidate it.
|
||||
// Server's generally throw away requests whose body length do not match the Content-Length header.
|
||||
|
|
@ -891,6 +899,7 @@ impl HttpContext for StreamContext {
|
|||
self.send_server_error(error, Some(StatusCode::BAD_REQUEST));
|
||||
}
|
||||
}
|
||||
self.set_custom_provider_headers();
|
||||
}
|
||||
|
||||
self.delete_content_length_header();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue