From eb9b5b6bb6402faf0f4253ce59e9c10fc40846ae Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 26 Mar 2026 09:43:04 -0700 Subject: [PATCH] Don't override user-defined Content-Type for GraphQL and form-urlencoded requests The frontend already sets the appropriate Content-Type header when selecting a body type, so the backend no longer needs to force it. This allows users to override Content-Type for servers with non-standard requirements. Fixes https://yaak.app/feedback/posts/graphql-mode-ignores-manual-content-type-header-override Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/yaak-http/src/types.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/yaak-http/src/types.rs b/crates/yaak-http/src/types.rs index b1e6e655..ed113752 100644 --- a/crates/yaak-http/src/types.rs +++ b/crates/yaak-http/src/types.rs @@ -226,10 +226,8 @@ async fn build_body( let (body, content_type) = match body_type.as_str() { "binary" => (build_binary_body(&body).await?, None), - "graphql" => (build_graphql_body(&method, &body), Some("application/json".to_string())), - "application/x-www-form-urlencoded" => { - (build_form_body(&body), Some("application/x-www-form-urlencoded".to_string())) - } + "graphql" => (build_graphql_body(&method, &body), None), + "application/x-www-form-urlencoded" => (build_form_body(&body), None), "multipart/form-data" => build_multipart_body(&body, &headers).await?, _ if body.contains_key("text") => (build_text_body(&body, body_type), None), t => {