OAuth fix lock from web app in case Invidious instance is not Playlet backend
This commit is contained in:
1 parent
dcadb1ec17
commit
32f0477f36
1 file changed
+9
-11
@@ -67,7 +67,11 @@ namespace Invidious
|
||||
end function
|
||||
|
||||
function GetInstance() as string
|
||||
instance = m.GetInstanceFromPreferences()
|
||||
if m.preferences = invalid
|
||||
m.preferences = m.invidiousNode.preferences
|
||||
end if
|
||||
instance = m.preferences["invidious.instance"]
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(instance)
|
||||
return instance
|
||||
end if
|
||||
@@ -81,13 +85,6 @@ namespace Invidious
|
||||
return instance
|
||||
end function
|
||||
|
||||
function GetInstanceFromPreferences() as string
|
||||
if m.preferences = invalid
|
||||
m.preferences = m.invidiousNode.preferences
|
||||
end if
|
||||
return m.preferences["invidious.instance"]
|
||||
end function
|
||||
|
||||
function MarkVideoWatched(videoId as dynamic) as void
|
||||
if StringUtils.IsNullOrEmpty(videoId)
|
||||
return
|
||||
@@ -392,12 +389,13 @@ namespace Invidious
|
||||
return request.Await()
|
||||
end if
|
||||
|
||||
isDefaultInstance = StringUtils.IsNullOrEmpty(m.GetInstanceFromPreferences())
|
||||
if not isDefaultInstance
|
||||
url = request.BuildUrl()
|
||||
isUrlToLocalServer = url.StartsWith("http://127.0.0.1:8888") or url.StartsWith(m.invidiousNode.webServer@.GetServerAddress())
|
||||
if not isUrlToLocalServer
|
||||
return request.Await()
|
||||
end if
|
||||
|
||||
parsedUrl = UrlUtils.ParseUrl(request.BuildUrl())
|
||||
parsedUrl = UrlUtils.ParseUrl(url)
|
||||
method = request.GetMethod()
|
||||
uri = parsedUrl.path
|
||||
headers = request.GetHeaders()
|
||||
|
||||
Reference in new issue
Block a user