summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Griffis <pgriffis@igalia.com>2021-09-22 11:54:34 -0500
committerAlexander Larsson <alexander.larsson@gmail.com>2022-01-11 11:51:02 +0100
commit5f8ce1d49124cd67caab5b6948ec00016ba97906 (patch)
tree2d2f3c6010a4b2e6995e3225d466f4a786fd2d84
parent8ce5211201a4c18556c256af69796c27de48fd7f (diff)
downloadflatpak-5f8ce1d49124cd67caab5b6948ec00016ba97906.tar.gz
Re-enable HTTP 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. (cherry picked from commit cda4967a9e2977caccafb6f72eceab1159db113f)
-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,