From 30468e378db6e5a1bf9b111c5e8a46bd510b3c86 Mon Sep 17 00:00:00 2001 From: nate Date: Thu, 19 Mar 2026 16:13:05 +0400 Subject: [PATCH] fix: default content type --- apps/monitor/src/runner.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/monitor/src/runner.rs b/apps/monitor/src/runner.rs index bc09273..f22aba4 100644 --- a/apps/monitor/src/runner.rs +++ b/apps/monitor/src/runner.rs @@ -300,14 +300,19 @@ fn run_check_blocking( .method(method) .uri(url); + let mut has_content_type = false; if let Some(hdrs) = headers { for (k, v) in hdrs { + if k.eq_ignore_ascii_case("content-type") { has_content_type = true; } builder = builder.header(k.as_str(), v.as_str()); } } let result = match body { Some(b) => { + if !has_content_type { + builder = builder.header("Content-Type", "application/json"); + } let req = builder.body(b.as_bytes()).map_err(|e| e.to_string())?; agent.run(req) }