summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeon Klingele <git@leonklingele.de>2019-08-14 23:28:56 +0200
committerLeon Klingele <git@leonklingele.de>2019-08-14 23:31:07 +0200
commit2a9a34816442a58a04ceccd05b814034c086535c (patch)
tree278bb71a5739e0e033a052440aae86848762090e /src
parentb63f469110b6d561e06ba7a39a459b71166ef523 (diff)
downloadinvidious-2a9a34816442a58a04ceccd05b814034c086535c.tar.gz
invidious-2a9a34816442a58a04ceccd05b814034c086535c.tar.bz2
invidious-2a9a34816442a58a04ceccd05b814034c086535c.zip
Format Crystal files
Crystal 0.30.1 apparently introduced some breaking changes to their code formatter which made CI fail. The code was automatically formatted by running crystal tool format
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/handlers.cr26
-rw-r--r--src/invidious/helpers/proxy.cr8
2 files changed, 17 insertions, 17 deletions
diff --git a/src/invidious/helpers/handlers.cr b/src/invidious/helpers/handlers.cr
index 7fbfb643..51bc9545 100644
--- a/src/invidious/helpers/handlers.cr
+++ b/src/invidious/helpers/handlers.cr
@@ -69,20 +69,20 @@ class FilteredCompressHandler < Kemal::Handler
return 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 %}
end
end
diff --git a/src/invidious/helpers/proxy.cr b/src/invidious/helpers/proxy.cr
index e3c9d2f5..fde282cd 100644
--- a/src/invidious/helpers/proxy.cr
+++ b/src/invidious/helpers/proxy.cr
@@ -31,10 +31,10 @@ class HTTPProxy
if 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