summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Griffis <pgriffis@igalia.com>2021-09-22 11:54:34 -0500
committerPhaedrus Leeds <mwleeds@protonmail.com>2021-11-08 17:00:38 -0800
commit653585ebdd3185ec32dbd61d0c6b9733e2e9797a (patch)
tree3f211bfdf26144e998bb18e2a5956d147d8fe1b9
parent998a300b29697e1fe31529fb1b7fc118ae2525d4 (diff)
downloadflatpak-653585ebdd3185ec32dbd61d0c6b9733e2e9797a.tar.gz
Re-enable HTTP compressionpgriffis/enable-soup-compression
The original commit (9865ed8989befe9653fb3cd919fb5518b09274d2) disabling it claimed it fixed OCI downloads. This no longer seems to be a problem. This has also exposed new bugs as some servers will send gzip compressed data when the client does not send Accept-Encoding. If we leave this enabled that issue goes away.
-rw-r--r--common/flatpak-utils-http.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/flatpak-utils-http.c b/common/flatpak-utils-http.c
index 2ba18d5c..0a230c37 100644
--- a/common/flatpak-utils-http.c
+++ b/common/flatpak-utils-http.c
@@ -540,7 +540,6 @@ flatpak_create_soup_session (const char *user_agent)
SOUP_SESSION_TIMEOUT, 60,
SOUP_SESSION_IDLE_TIMEOUT, 60,
NULL);
- soup_session_remove_feature_by_type (soup_session, SOUP_TYPE_CONTENT_DECODER);
http_proxy = g_getenv ("http_proxy");
if (http_proxy)
{
@@ -955,10 +954,13 @@ flatpak_cache_http_uri_once (SoupSession *soup_session,
if (flags & FLATPAK_HTTP_FLAGS_STORE_COMPRESSED)
{
+ soup_session_remove_feature_by_type (soup_session, SOUP_TYPE_CONTENT_DECODER);
soup_message_headers_replace (m->request_headers, "Accept-Encoding",
"gzip");
data.store_compressed = TRUE;
}
+ else if (!soup_session_has_feature (soup_session, SOUP_TYPE_CONTENT_DECODER))
+ soup_session_add_feature_by_type (soup_session, SOUP_TYPE_CONTENT_DECODER);
soup_request_send_async (SOUP_REQUEST (request),
cancellable,