Exemplo n.º 1
0
def is_encoding_acceptable(encoding_to_check):
    "Check if a content encoding is acceptable to the user agent."
    header = request.headers.get('Accept-Encoding', '')
    return 'gzip' in desired_matches(['gzip'], header)
Exemplo n.º 2
0
 def match_accept(self, mimetypes):
     """Return a list of specified mime-types that the browser's HTTP Accept
     header allows in the order provided."""
     return desired_matches(mimetypes,
                            self.environ.get('HTTP_ACCEPT', '*/*'))
Exemplo n.º 3
0
def is_encoding_acceptable(encoding_to_check):
    "Check if a content encoding is acceptable to the user agent."
    header = request.headers.get('Accept-Encoding', '')
    return 'gzip' in desired_matches(['gzip'], header)
Exemplo n.º 4
0
 def match_accept(self, mimetypes):
     """Return a list of specified mime-types that the browser's HTTP Accept
     header allows in the order provided."""
     return desired_matches(mimetypes, 
                            self.environ.get('HTTP_ACCEPT', '*/*'))
Exemplo n.º 5
0
 def request_accepts_gzip(environ):
     accept_encoding = environ.get("HTTP_ACCEPT_ENCODING", "identity")
     return "gzip" in desired_matches(["gzip"], accept_encoding)
Exemplo n.º 6
0
 def request_accepts_gzip(environ):
     accept_encoding = environ.get("HTTP_ACCEPT_ENCODING", "identity")
     return "gzip" in desired_matches(["gzip"], accept_encoding)