Compare commits

..

1 Commits

Author SHA1 Message Date
Gregory Schier
eb9b5b6bb6 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) <noreply@anthropic.com>
2026-03-26 09:43:04 -07:00
5 changed files with 13 additions and 15 deletions

View File

@@ -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 => {

16
package-lock.json generated
View File

@@ -77,7 +77,7 @@
"nodejs-file-downloader": "^4.13.0",
"npm-run-all": "^4.1.5",
"typescript": "^5.8.3",
"vite-plus": "*",
"vite-plus": "latest",
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
}
},
@@ -16474,9 +16474,9 @@
"license": "ISC"
},
"node_modules/yaml": {
"version": "2.8.3",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz",
"integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==",
"version": "2.8.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz",
"integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==",
"license": "ISC",
"bin": {
"yaml": "bin.mjs"
@@ -16724,7 +16724,7 @@
"name": "@yaak/importer-insomnia",
"version": "0.1.0",
"dependencies": {
"yaml": "^2.8.3"
"yaml": "^2.4.2"
}
},
"plugins/importer-openapi": {
@@ -16732,7 +16732,7 @@
"version": "0.1.0",
"dependencies": {
"openapi-to-postmanv2": "^5.8.0",
"yaml": "^2.8.3"
"yaml": "^2.4.2"
},
"devDependencies": {
"@types/openapi-to-postmanv2": "^5.0.0"
@@ -16922,7 +16922,7 @@
"uuid": "^11.1.0",
"vkbeautify": "^0.99.3",
"whatwg-mimetype": "^4.0.0",
"yaml": "^2.8.3"
"yaml": "^2.6.1"
},
"devDependencies": {
"@lezer/generator": "^1.8.0",
@@ -16950,7 +16950,7 @@
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
"vite-plugin-static-copy": "^3.3.0",
"vite-plugin-svgr": "^4.5.0",
"vite-plus": "*"
"vite-plus": "latest"
}
},
"src-web/node_modules/@rolldown/pluginutils": {

View File

@@ -10,6 +10,6 @@
"test": "vp test --run tests"
},
"dependencies": {
"yaml": "^2.8.3"
"yaml": "^2.4.2"
}
}

View File

@@ -11,7 +11,7 @@
},
"dependencies": {
"openapi-to-postmanv2": "^5.8.0",
"yaml": "^2.8.3"
"yaml": "^2.4.2"
},
"devDependencies": {
"@types/openapi-to-postmanv2": "^5.0.0"

View File

@@ -73,7 +73,7 @@
"uuid": "^11.1.0",
"vkbeautify": "^0.99.3",
"whatwg-mimetype": "^4.0.0",
"yaml": "^2.8.3"
"yaml": "^2.6.1"
},
"devDependencies": {
"@lezer/generator": "^1.8.0",