mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-06-27 17:38:25 +00:00
cookies: remove port number from domain if it exists
Some checks are pending
Invidious CI / lint (push) Waiting to run
Build and release container directly from master / release (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Waiting to run
Invidious CI / build-docker (push) Waiting to run
Invidious CI / build-docker-arm64 (push) Waiting to run
Some checks are pending
Invidious CI / lint (push) Waiting to run
Build and release container directly from master / release (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Waiting to run
Invidious CI / build-docker (push) Waiting to run
Invidious CI / build-docker-arm64 (push) Waiting to run
This commit is contained in:
parent
642b2e8bf0
commit
be9a3794e9
@ -11,6 +11,10 @@ struct Invidious::User
|
||||
# Session ID (SID) cookie
|
||||
# Parameter "domain" comes from the global config
|
||||
def sid(domain : String?, sid) : HTTP::Cookie
|
||||
# Strip the port from the domain if it's being accessed from another port
|
||||
# Browsers will reject the cookie if it contains the port number. This is
|
||||
# because `example.com:3000` is not the same as `example.com` on a cookie.
|
||||
domain = domain.split(":")[0]
|
||||
# Not secure if it's being accessed from I2P
|
||||
# Browsers expect the domain to include https. On I2P there is no HTTPS
|
||||
if domain.not_nil!.split(".").last == "i2p"
|
||||
@ -30,6 +34,10 @@ struct Invidious::User
|
||||
# Preferences (PREFS) cookie
|
||||
# Parameter "domain" comes from the global config
|
||||
def prefs(domain : String?, preferences : Preferences) : HTTP::Cookie
|
||||
# Strip the port from the domain if it's being accessed from another port
|
||||
# Browsers will reject the cookie if it contains the port number. This is
|
||||
# because `example.com:3000` is not the same as `example.com` on a cookie.
|
||||
domain = domain.split(":")[0]
|
||||
# Not secure if it's being accessed from I2P
|
||||
# Browsers expect the domain to include https. On I2P there is no HTTPS
|
||||
if domain.not_nil!.split(".").last == "i2p"
|
||||
@ -53,6 +61,8 @@ struct Invidious::User
|
||||
server_id = rand(CONFIG.invidious_companion.size)
|
||||
end
|
||||
# Strip the port from the domain if it's being accessed from another port
|
||||
# Browsers will reject the cookie if it contains the port number. This is
|
||||
# because `example.com:3000` is not the same as `example.com` on a cookie.
|
||||
domain = domain.split(":")[0]
|
||||
# Not secure if it's being accessed from I2P
|
||||
# Browsers expect the domain to include https. On I2P there is no HTTPS
|
||||
|
Loading…
Reference in New Issue
Block a user