Add compile-time flag to remove code for QUIC

This commit is contained in:
syeopite
2021-08-30 14:55:35 -07:00
parent a12571e748
commit d379a36c0e
2 changed files with 33 additions and 8 deletions

View File

@@ -53,7 +53,13 @@ module Invidious::Routes::Login
# See https://github.com/ytdl-org/youtube-dl/blob/2019.04.07/youtube_dl/extractor/youtube.py#L82
begin
client = QUIC::Client.new(LOGIN_URL)
client = nil # Declare variable
{% unless flag?(:disable_quic) %}
client = QUIC::Client.new(LOGIN_URL)
{% else %}
client = HTTP::Client.new(LOGIN_URL)
{% end %}
headers = HTTP::Headers.new
login_page = client.get("/ServiceLogin")