diff options
author | Patrick Griffis <pgriffis@igalia.com> | 2021-09-22 11:54:34 -0500 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2021-11-15 11:12:01 +0100 |
commit | cda4967a9e2977caccafb6f72eceab1159db113f (patch) | |
tree | 362aeab70675d34799017fca738e51e9d4a7ee18 | |
parent | e2b36d3f1c08ab30d011638e7841d692f2f95ae2 (diff) | |
download | flatpak-cda4967a9e2977caccafb6f72eceab1159db113f.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.
-rw-r--r-- | common/flatpak-utils-http.c | 4 |
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, |