mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-10-31 12:42:09 +00:00 
			
		
		
		
	Fix gzip decompression with HTTP::Client
This commit is contained in:
		| @@ -404,10 +404,17 @@ module YoutubeAPI | ||||
|     url = "#{endpoint}?key=#{client_config.api_key}" | ||||
|  | ||||
|     headers = HTTP::Headers{ | ||||
|       "Content-Type"    => "application/json; charset=UTF-8", | ||||
|       "Accept-Encoding" => "gzip", | ||||
|       "Content-Type" => "application/json; charset=UTF-8", | ||||
|     } | ||||
|  | ||||
|     # 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}") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syeopite
					syeopite