!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.4.18 (Ubuntu). PHP/7.0.33-0ubuntu0.16.04.16 

uname -a: Linux digifus 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/local/lib/python2.7/dist-packages/flask_api/   drwxr-sr-x
Free 9.54 GB of 29.4 GB (32.45%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     negotiation.py (1.98 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# coding: utf8
from __future__ import unicode_literals
from flask import request
from flask_api import exceptions
from flask_api.mediatypes import MediaType, parse_accept_header


class BaseNegotiation(object):
    def select_parser(self, parsers):
        msg = '`select_parser()` method must be implemented for class "%s"'
        raise NotImplementedError(msg % self.__class__.__name__)

    def select_renderer(self, renderers):
        msg = '`select_renderer()` method must be implemented for class "%s"'
        raise NotImplementedError(msg % self.__class__.__name__)


class DefaultNegotiation(BaseNegotiation):
    def select_parser(self, parsers):
        """
        Determine which parser to use for parsing the request body.
        Returns a two-tuple of (parser, content type).
        """
        content_type_header = request.content_type

        client_media_type = MediaType(content_type_header)
        for parser in parsers:
            server_media_type = MediaType(parser.media_type)
            if server_media_type.satisfies(client_media_type):
                return (parser, client_media_type)

        raise exceptions.UnsupportedMediaType()

    def select_renderer(self, renderers):
        """
        Determine which renderer to use for rendering the response body.
        Returns a two-tuple of (renderer, content type).
        """
        accept_header = request.headers.get('Accept', '*/*')

        for client_media_types in parse_accept_header(accept_header):
            for renderer in renderers:
                server_media_type = MediaType(renderer.media_type)
                for client_media_type in client_media_types:
                    if client_media_type.satisfies(server_media_type):
                        if server_media_type.precedence > client_media_type.precedence:
                            return (renderer, server_media_type)
                        else:
                            return (renderer, client_media_type)

        raise exceptions.NotAcceptable()

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0045 ]--