Invidious is an alternative front-end to YouTube
Set domain to be nil by default
Omar Roth17cf0772fb9a
diff --git a/config/config.yml b/config/config.ymlindex f981a398..c6f8420a 100644--- a/config/config.yml+++ b/config/config.yml@@ -10,4 +10,4 @@ db:dbname: invidiousfull_refresh: falsehttps_only: false-domain: invidio.us+domain:diff --git a/src/invidious.cr b/src/invidious.crindex d9b88a0c..88f258c6 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -1056,7 +1056,7 @@ post "/login" do |env|endif config.domain- env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: ".#{config.domain}", value: sid, expires: Time.now + 2.years,+ env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: "#{config.domain}", value: sid, expires: Time.now + 2.years,secure: secure, http_only: true)elseenv.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", value: sid, expires: Time.now + 2.years,@@ -1118,7 +1118,7 @@ post "/login" do |env|endif config.domain- env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: ".#{config.domain}", value: sid, expires: Time.now + 2.years,+ env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: "#{config.domain}", value: sid, expires: Time.now + 2.years,secure: secure, http_only: true)elseenv.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", value: sid, expires: Time.now + 2.years,diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.crindex f5838622..5ccc1009 100644--- a/src/invidious/helpers/utils.cr+++ b/src/invidious/helpers/utils.cr@@ -200,7 +200,12 @@ def make_host_url(ssl, host)scheme = "http://"end- return "#{scheme}#{host}"+ if host+ host = host.lchop(".")+ return "#{scheme}#{host}"+ else+ return ""+ endenddef get_referer(env, fallback = "/")