Check IPv6 HTTP host when retrieving app URL

This commit is contained in:
JonnyWong16 2022-09-18 15:34:11 -07:00
commit 894eaf0365
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 5 additions and 4 deletions

View file

@ -58,7 +58,7 @@ DOCUMENTATION :: END
getPlexPyURL = function () {
var deferred = $.Deferred();
if (location.hostname !== "localhost" && location.hostname !== "127.0.0.1") {
if (location.hostname !== "localhost" && location.hostname !== "127.0.0.1" && location.hostname !== "[::1]") {
deferred.resolve(location.href.split('/settings')[0]);
} else {
$.get('get_plexpy_url').then(function (url) {
@ -74,7 +74,7 @@ DOCUMENTATION :: END
var hostname = parser.hostname;
var protocol = parser.protocol;
if (hostname === '127.0.0.1' || hostname === 'localhost') {
if (hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '[::1]') {
$('#api_qr_localhost').toggle(true);
$('#api_qr_private').toggle(false);
} else {