From: Michael Tremer Date: Sat, 21 Jun 2025 16:51:09 +0000 (+0000) Subject: xfer: Send the appropriate content type header is sending JSON X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e12b74a6cfc66784665115b1d01cd99fc66a1780;p=pakfire.git xfer: Send the appropriate content type header is sending JSON Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/xfer.c b/src/pakfire/xfer.c index 0c018e62..ccd7ec87 100644 --- a/src/pakfire/xfer.c +++ b/src/pakfire/xfer.c @@ -708,6 +708,12 @@ int pakfire_xfer_set_payload(struct pakfire_xfer* self, const char* payload) { int pakfire_xfer_set_json_payload(struct pakfire_xfer* self, struct json_object* json) { const char* s = NULL; + int r; + + // Set the Content-Type header + r = pakfire_xfer_add_header(self, "Content-Type: application/json"); + if (r < 0) + return r; // Convert the payload to string s = pakfire_json_to_string(json);