Invidious is an alternative front-end to YouTube
Format Crystal files
Leon Klingele2a9a34816442
diff --git a/src/invidious/helpers/handlers.cr b/src/invidious/helpers/handlers.crindex 7fbfb643..51bc9545 100644--- a/src/invidious/helpers/handlers.cr+++ b/src/invidious/helpers/handlers.cr@@ -69,20 +69,20 @@ class FilteredCompressHandler < Kemal::Handlerreturn call_next env if exclude_match? env{% if flag?(:without_zlib) %}- call_next env- {% else %}- request_headers = env.request.headers-- if request_headers.includes_word?("Accept-Encoding", "gzip")- env.response.headers["Content-Encoding"] = "gzip"- env.response.output = Gzip::Writer.new(env.response.output, sync_close: true)- elsif request_headers.includes_word?("Accept-Encoding", "deflate")- env.response.headers["Content-Encoding"] = "deflate"- env.response.output = Flate::Writer.new(env.response.output, sync_close: true)- end+ call_next env+ {% else %}+ request_headers = env.request.headers++ if request_headers.includes_word?("Accept-Encoding", "gzip")+ env.response.headers["Content-Encoding"] = "gzip"+ env.response.output = Gzip::Writer.new(env.response.output, sync_close: true)+ elsif request_headers.includes_word?("Accept-Encoding", "deflate")+ env.response.headers["Content-Encoding"] = "deflate"+ env.response.output = Flate::Writer.new(env.response.output, sync_close: true)+ end- call_next env- {% end %}+ call_next env+ {% end %}endenddiff --git a/src/invidious/helpers/proxy.cr b/src/invidious/helpers/proxy.crindex e3c9d2f5..fde282cd 100644--- a/src/invidious/helpers/proxy.cr+++ b/src/invidious/helpers/proxy.cr@@ -31,10 +31,10 @@ class HTTPProxyif resp[:code]? == 200{% if !flag?(:without_openssl) %}- if tls- tls_socket = OpenSSL::SSL::Socket::Client.new(socket, context: tls, sync_close: true, hostname: host)- socket = tls_socket- end+ if tls+ tls_socket = OpenSSL::SSL::Socket::Client.new(socket, context: tls, sync_close: true, hostname: host)+ socket = tls_socket+ end{% end %}return socket