Example #1
0
    def do_GET(self):
        """
        Handle GET requests
        """

        self.parse()
        path = self.path[1:].split('/')

        ok = True

        if not self.checkAuthorization():
            self.sendAuthorization()
            return

        ok = False
        if len(path):
            if path[0] == 'ajax':
                AjaxHandler.execute(self)
                ok = True
            elif path[0] == 'pack':
                PackHandler.execute(self)
                ok = True
            elif path[0] == 'renders':
                RendersHandler.execute(self)
                ok = True
            elif path[0] == 'logs':
                LogsHandler.execute(self)
                ok = True

        if not ok:
            FileHandler.execute(self)
Example #2
0
    def sendAuthorization(self):
        """
        Send authorization prompt
        """

        self.send_response(401, 'Authorization Required')
        self.send_header('WWW-Authenticate', 'Basic realm="Renderfarm login"')

        fname = os.path.join(self.server.getSiteRoot(), 'authfail.html')
        FileHandler.send_file(self, fname)