From: Yamagishi Kazutoshi Date: Wed, 9 May 2018 14:59:39 +0000 (+0900) Subject: Support gzip encoding on Request (#7425) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=edf882320a12b2c0cfa7fc0fb7eafaa39021cb0f;p=mastodon.git Support gzip encoding on Request (#7425) --- diff --git a/app/lib/request.rb b/app/lib/request.rb index 00f94dacf..fc7d398e0 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -51,7 +51,7 @@ class Request end def headers - (@account ? @headers.merge('Signature' => signature) : @headers).without(REQUEST_TARGET) + (@account ? @headers.merge('Signature' => signature) : @headers).reverse_merge('Accept-Encoding' => 'gzip').without(REQUEST_TARGET) end private @@ -100,7 +100,7 @@ class Request end def http_client - @http_client ||= HTTP.timeout(:per_operation, timeout).follow(max_hops: 2) + @http_client ||= HTTP.use(:auto_inflate).timeout(:per_operation, timeout).follow(max_hops: 2) end def use_proxy?