check if @@secure is already true before changing it's value

This commit is contained in:
Fijxu 2026-02-23 19:36:59 -03:00
parent 52d64e37ea
commit f5bf274a53
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4

View File

@ -14,7 +14,7 @@ struct Invidious::User
# Not secure if it's being accessed from I2P # Not secure if it's being accessed from I2P
# Browsers expect the domain to include https. On I2P there is no HTTPS # Browsers expect the domain to include https. On I2P there is no HTTPS
# Tor browser works fine with secure being true # Tor browser works fine with secure being true
if domain.try &.split(".").last == "i2p" if (domain.try &.split(".").last == "i2p") && @@secure
@@secure = false @@secure = false
end end
@ -35,7 +35,7 @@ struct Invidious::User
# Not secure if it's being accessed from I2P # Not secure if it's being accessed from I2P
# Browsers expect the domain to include https. On I2P there is no HTTPS # Browsers expect the domain to include https. On I2P there is no HTTPS
# Tor browser works fine with secure being true # Tor browser works fine with secure being true
if domain.try &.split(".").last == "i2p" if (domain.try &.split(".").last == "i2p") && @@secure
@@secure = false @@secure = false
end end