Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/openshell-router/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ pub async fn verify_backend_endpoint(
route: &ResolvedRoute,
) -> Result<ValidatedEndpoint, ValidationFailure> {
let probe = validation_probe(route)?;
let headers = vec![("content-type".to_string(), "application/json".to_string())];

if mock::is_mock_route(route) {
return Ok(ValidatedEndpoint {
Expand All @@ -232,7 +233,7 @@ pub async fn verify_backend_endpoint(
});
}

let response = send_backend_request(client, route, "POST", probe.path, Vec::new(), probe.body)
let response = send_backend_request(client, route, "POST", probe.path, headers, probe.body)
.await
.map_err(|err| match err {
RouterError::UpstreamUnavailable(details) => ValidationFailure {
Expand Down Expand Up @@ -429,6 +430,7 @@ mod tests {
Mock::given(method("POST"))
.and(path("/v1/messages"))
.and(header("x-api-key", "sk-test"))
.and(header("content-type", "application/json"))
.and(header("anthropic-version", "2023-06-01"))
.and(body_partial_json(serde_json::json!({
"model": "test-model",
Expand Down
1 change: 1 addition & 0 deletions crates/openshell-server/src/inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ mod tests {
Mock::given(method("POST"))
.and(path("/v1/chat/completions"))
.and(header("authorization", "Bearer sk-test"))
.and(header("content-type", "application/json"))
.and(body_partial_json(serde_json::json!({
"model": "gpt-4o-mini",
"max_tokens": 1,
Expand Down
Loading