Skip to content

Commit

Permalink
httpserver.py: fix last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lupomeo committed Jan 1, 2012
1 parent cfdbf5d commit 6f4eb87
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin/httpserver.py
Expand Up @@ -86,6 +86,9 @@ def __init__(self, session, root):


def render(self, request):
if request.getClientIP() == "127.0.0.1":
return self.resource.render(request)

if self.login(request.getUser(), request.getPassword()) == False:
request.setHeader('WWW-authenticate', 'Basic realm="%s"' % ("OpenWebif"))
errpage = error.ErrorPage(http.UNAUTHORIZED,"Unauthorized","401 Authentication required")
Expand All @@ -95,6 +98,9 @@ def render(self, request):


def getChildWithDefault(self, path, request):
if request.getClientIP() == "127.0.0.1":
return self.resource.getChildWithDefault(path, request)

if self.login(request.getUser(), request.getPassword()) == False:
request.setHeader('WWW-authenticate', 'Basic realm="%s"' % ("OpenWebif"))
errpage = error.ErrorPage(http.UNAUTHORIZED,"Unauthorized","401 Authentication required")
Expand Down

0 comments on commit 6f4eb87

Please sign in to comment.