mirror of
https://github.com/katanemo/plano.git
synced 2026-06-29 15:49:40 +02:00
add ability to specify custom http headers in api endpoint (#386)
This commit is contained in:
parent
e82f8f216f
commit
2bd61d628c
11 changed files with 179 additions and 10 deletions
|
|
@ -242,6 +242,7 @@ pub struct EndpointDetails {
|
|||
pub path: Option<String>,
|
||||
#[serde(rename = "http_method")]
|
||||
pub method: Option<HttpMethod>,
|
||||
pub http_headers: Option<HashMap<String, String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
|
|||
|
|
@ -322,6 +322,12 @@ impl StreamContext {
|
|||
headers.insert(TRACE_PARENT_HEADER, self.traceparent.as_ref().unwrap());
|
||||
}
|
||||
|
||||
// override http headers that are set in the prompt target
|
||||
let http_headers = endpoint_details.http_headers.clone().unwrap_or_default();
|
||||
for (key, value) in http_headers.iter() {
|
||||
headers.insert(key.as_str(), value.as_str());
|
||||
}
|
||||
|
||||
let call_args = CallArgs::new(
|
||||
ARCH_INTERNAL_CLUSTER_NAME,
|
||||
&path,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue