Package: net-cpp / 2.2.1+dfsg1-6

1002_set-content-type-header-on-POSTs.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 8567cc6014399259bf6efa5574f0ac7e98e70094 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 9 Feb 2019 01:32:44 +0100
Subject: [PATCH] Set the Content-Type header on POST, otherwise stuff breaks

---
 src/core/net/http/impl/curl/client.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/net/http/impl/curl/client.cpp b/src/core/net/http/impl/curl/client.cpp
index ba68cda..f49ce67 100644
--- a/src/core/net/http/impl/curl/client.cpp
+++ b/src/core/net/http/impl/curl/client.cpp
@@ -158,9 +158,12 @@ std::shared_ptr<http::impl::curl::Request> http::impl::curl::Client::post_impl(
         const std::string& ct)
 {
     ::curl::easy::Handle handle;
+    http::Header ctheader;
+    ctheader.set("Content-Type", ct);
     handle.method(http::Method::post)
             .url(configuration.uri.c_str())
             .header(configuration.header)
+            .header(ctheader)
             .post_data(payload.c_str(), ct);
 
     handle.set_option(::curl::Option::ssl_verify_host,
-- 
2.24.1