mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Sanity check + comment why we add a leading dot
This commit is contained in:
parent
6aa7db2358
commit
95d86ebf22
1 changed files with 2 additions and 1 deletions
|
@ -222,7 +222,8 @@ function updateCookie(newVolume, newSpeed) {
|
||||||
var ipRegex = /^((\d+\.){3}\d+|[A-Fa-f0-9]*:[A-Fa-f0-9:]*:[A-Fa-f0-9:]+)$/;
|
var ipRegex = /^((\d+\.){3}\d+|[A-Fa-f0-9]*:[A-Fa-f0-9:]*:[A-Fa-f0-9:]+)$/;
|
||||||
var domainUsed = window.location.hostname;
|
var domainUsed = window.location.hostname;
|
||||||
|
|
||||||
if (!ipRegex.test(domainUsed) && domainUsed != 'localhost')
|
// Fix for a bug in FF where the leading dot in the FQDN is not ignored
|
||||||
|
if (domainUsed.charAt(0) != '.' && !ipRegex.test(domainUsed) && domainUsed != 'localhost')
|
||||||
domainUsed = '.' + window.location.hostname;
|
domainUsed = '.' + window.location.hostname;
|
||||||
|
|
||||||
document.cookie = 'PREFS=' + cookieData + '; SameSite=Strict; path=/; domain=' +
|
document.cookie = 'PREFS=' + cookieData + '; SameSite=Strict; path=/; domain=' +
|
||||||
|
|
Loading…
Reference in a new issue