blob: 83a0498223ab8fe2c346bad7875336a2166df0dc [file] [log] [blame]
Jan Kundrát8cd0e252019-12-05 17:49:48 +01001From 256274e4ca5786b4e68011fcb1b31272e278141d Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
3Date: Thu, 5 Dec 2019 17:03:06 +0100
4Subject: [PATCH] curl: Enable decoding from server's Content-Encoding
5
6I would like to consume RAUC bundles straight from our CI environment
7which uses OpenStack Swift as a backend for artifact storage, and
8OpenDev's Zuul as the CI runner. As it happens, our CI jobs sends file
9content to Swift with a Content-Encoding: gzip [1], and Swift appears to
10always send the file with that Content-Encoding no matter what
11Accept-Encoding the HTTP client sends in their request.
12
13This patch simply uses curl's list of default supported Content-Encoding
14decoders (that's the special magic "" value of this header). The end
15result is that our boxes can now fetch stuff from our CI environment
16without any problems.
17
18[1] https://review.opendev.org/688154
19---
20 src/network.c | 1 +
21 1 file changed, 1 insertion(+)
22
23diff --git a/src/network.c b/src/network.c
24index ade9f21..5793093 100644
25--- a/src/network.c
26+++ b/src/network.c
27@@ -93,6 +93,7 @@ static gboolean transfer(RaucTransfer *xfer, GError **error)
28 curl_easy_setopt(curl, CURLOPT_XFERINFODATA, xfer);
29 curl_easy_setopt(curl, CURLOPT_FAILONERROR, xfer);
30 curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
31+ curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, ""); /* decode all supported Accept-Encoding headers */
32
33 /* set error buffer empty before perorming a request */
34 errbuf[0] = 0;
35--
362.21.0
37