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) }