aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/clients
diff options
context:
space:
mode:
authorJoakim Lindqvist <[email protected]>2026-04-14 16:56:49 +0200
committerGitHub Enterprise <[email protected]>2026-04-14 16:56:49 +0200
commit7980f3be6566c0a06c82765f595b6c591ed9a0fa (patch)
treeffe8decaebb89fcb9dd355c47dff51e825dd98d4 /src/zenhttp/clients
parent5.8.4 (diff)
downloadzen-7980f3be6566c0a06c82765f595b6c591ed9a0fa.tar.xz
zen-7980f3be6566c0a06c82765f595b6c591ed9a0fa.zip
fix OAuth client credentials content type override (#957)
- Bugfix: OAuth client credentials token request now sends correct `application/x-www-form-urlencoded` content type - Improvement: HTTP client Content-Type in additional headers now overrides the payload content type
Diffstat (limited to 'src/zenhttp/clients')
-rw-r--r--src/zenhttp/clients/httpclientcurlhelpers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/zenhttp/clients/httpclientcurlhelpers.h b/src/zenhttp/clients/httpclientcurlhelpers.h
index 0605a30f6..cb5f5d9a9 100644
--- a/src/zenhttp/clients/httpclientcurlhelpers.h
+++ b/src/zenhttp/clients/httpclientcurlhelpers.h
@@ -255,8 +255,13 @@ BuildHeaderList(const HttpClient::KeyValueMap& AdditionalHeader,
Headers = curl_slist_append(Headers, AuthHeader.c_str());
}
+ bool HasContentTypeOverride = AdditionalHeader->contains("Content-Type");
for (const auto& [Key, Value] : ExtraHeaders)
{
+ if (HasContentTypeOverride && Key == "Content-Type")
+ {
+ continue;
+ }
ExtendableStringBuilder<128> HeaderLine;
HeaderLine << Key << ": " << Value;
Headers = curl_slist_append(Headers, HeaderLine.c_str());