aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/httpclient_test.cpp
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/httpclient_test.cpp
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/httpclient_test.cpp')
-rw-r--r--src/zenhttp/httpclient_test.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/zenhttp/httpclient_test.cpp b/src/zenhttp/httpclient_test.cpp
index 67cbaea9b..deaeca2a8 100644
--- a/src/zenhttp/httpclient_test.cpp
+++ b/src/zenhttp/httpclient_test.cpp
@@ -414,6 +414,17 @@ TEST_CASE("httpclient.post")
CHECK_EQ(Resp.AsText(), "{\"key\":\"value\"}");
}
+ SUBCASE("POST with content type override via additional header")
+ {
+ const char* Payload = "test payload";
+ IoBuffer Buf(IoBuffer::Clone, Payload, strlen(Payload));
+
+ HttpClient::Response Resp = Client.Post("/api/test/echo", Buf, ZenContentType::kJSON, {{"Content-Type", "text/plain"}});
+ CHECK(Resp.IsSuccess());
+ CHECK_EQ(Resp.AsText(), "test payload");
+ CHECK_EQ(Resp.ResponsePayload.GetContentType(), ZenContentType::kText);
+ }
+
SUBCASE("POST with CbObject payload round-trip")
{
CbObjectWriter Writer;