Ejemplo n.º 1
0
    def handle(self, context):
        """
        Dispatch the request to every HttpPlugin
        """

        if hasattr(context.session, 'appcontext'):
            self.context = context.session.appcontext
        else:
            self.context = manager.context

        if context.path.startswith('/ajenti:socket'):
            return context.fallthrough(self.io)

        for instance in HttpPlugin.get_all():
            output = instance.handle(context)
            if output is not None:
                return output
        return context.fallthrough(self.invalid)
Ejemplo n.º 2
0
    def handle(self, context):
        """
        Dispatch the request to every HttpPlugin
        """

        if hasattr(context.session, 'appcontext'):
            self.context = context.session.appcontext
        else:
            self.context = manager.context

        if context.path.startswith('/ajenti:socket'):
            return context.fallthrough(self.io)

        for instance in HttpPlugin.get_all():
            output = instance.handle(context)
            if output is not None:
                return output
        return context.fallthrough(self.invalid)
Ejemplo n.º 3
0
    def handle(self, context):
        """
        Dispatch the request to every HttpPlugin
        """

        if hasattr(context.session, 'appcontext'):
            self.context = context.session.appcontext
        else:
            self.context = manager.context

        if context.path.startswith('/ajenti:socket'):
            return context.fallthrough(self.io)

        if not hasattr(self.context, 'http_handlers'):
            self.context.http_handlers = HttpPlugin.get_all()

        for instance in self.context.http_handlers:
            try:
                output = instance.handle(context)
            except Exception, e:
                return [self.respond_error(context, e)]
            if output is not None:
                return output
Ejemplo n.º 4
0
    def handle(self, context):
        """
        Dispatch the request to every HttpPlugin
        """

        if hasattr(context.session, 'appcontext'):
            self.context = context.session.appcontext
        else:
            self.context = manager.context

        if context.path.startswith('/ajenti:socket'):
            return context.fallthrough(self.io)

        if not hasattr(self.context, 'http_handlers'):
            self.context.http_handlers = HttpPlugin.get_all()

        for instance in self.context.http_handlers:
            try:
                output = instance.handle(context)
            except Exception, e:
                return [self.respond_error(context, e)]
            if output is not None:
                return output