Fix gzip decompression with HTTP::Client

pull/2364/head
syeopite 3 years ago
parent d379a36c0e
commit b0f127d4d8
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82

@ -405,9 +405,16 @@ module YoutubeAPI
headers = HTTP::Headers{
"Content-Type" => "application/json; charset=UTF-8",
"Accept-Encoding" => "gzip",
}
# The normal HTTP client automatically applies accept-encoding: gzip,
# and decompresses. However, explicitly applying it will remove this functionality.
#
# https://github.com/crystal-lang/crystal/issues/11252#issuecomment-929594741
{% unless flag?(:disable_quic) %}
headers["Accept-Encoding"] = "gzip"
{% end %}
# Logging
LOGGER.debug("YoutubeAPI: Using endpoint: \"#{endpoint}\"")
LOGGER.trace("YoutubeAPI: ClientConfig: #{client_config}")

Loading…
Cancel
Save