Skip to content

Commit

Permalink
Fix login issues with streaming
Browse files Browse the repository at this point in the history
Fixes Vu+ Transcoding would require insane settings (no auth required).
With this fix, authorization for web logins can stay enabled and transcoded streaming will still work!
  • Loading branch information
Schimmelreiter committed Mar 29, 2014
1 parent 59da3f2 commit fc16ec7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugin/httpserver.py
Expand Up @@ -177,7 +177,9 @@ def __init__(self, session, root):


def render(self, request):
if request.getClientIP() == "127.0.0.1" and not config.OpenWebif.auth_for_streaming.value:
host = request.getHost().host

if (host == "localhost" or host == "127.0.0.1" or host == "::ffff:127.0.0.1") and not config.OpenWebif.auth_for_streaming.value:
return self.resource.render(request)

if self.login(request.getUser(), request.getPassword()) == False:
Expand All @@ -190,8 +192,9 @@ def render(self, request):

def getChildWithDefault(self, path, request):
session = request.getSession().sessionNamespaces

if request.getClientIP() == "127.0.0.1" and not config.OpenWebif.auth_for_streaming.value:
host = request.getHost().host

if (host == "localhost" or host == "127.0.0.1" or host == "::ffff:127.0.0.1") and not config.OpenWebif.auth_for_streaming.value:
return self.resource.getChildWithDefault(path, request)

if "logged" in session.keys() and session["logged"]:
Expand Down

0 comments on commit fc16ec7

Please sign in to comment.