From 8a4b36eff3b9d3d308ec997d036a81160682f86b Mon Sep 17 00:00:00 2001 From: Will Burford Date: Mon, 16 Mar 2026 19:52:24 -0400 Subject: [PATCH] fix(verification): send content type Signed-off-by: Will Burford --- crates/openshell-router/src/backend.rs | 4 +++- crates/openshell-server/src/inference.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/openshell-router/src/backend.rs b/crates/openshell-router/src/backend.rs index f9d53800..5ac4b38f 100644 --- a/crates/openshell-router/src/backend.rs +++ b/crates/openshell-router/src/backend.rs @@ -224,6 +224,7 @@ pub async fn verify_backend_endpoint( route: &ResolvedRoute, ) -> Result { 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 { @@ -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 { @@ -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", diff --git a/crates/openshell-server/src/inference.rs b/crates/openshell-server/src/inference.rs index c1354e75..d9498463 100644 --- a/crates/openshell-server/src/inference.rs +++ b/crates/openshell-server/src/inference.rs @@ -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,