def url(self, context):
     result = super(StaticFilesNode, self).url(context)
     if "request" in context:
         request = context["request"]
         if utils.accepts_gzip(request) and utils.should_save_gzipped_copy(result):
             return utils.get_gzipped_name(result)
     return result
def accepts_gzip(request):
    """
    defines ACCEPTS_GZIP -- a boolean which reflects whether
    the request accepts Content-Type: gzip.

    """

    return {'ACCEPTS_GZIP': utils.accepts_gzip(request)}
Esempio n. 3
0
 def url(self, context):
     result = super(StaticFilesNode, self).url(context)
     if 'request' in context:
         request = context['request']
         if (utils.accepts_gzip(request)
                 and utils.should_save_gzipped_copy(result)):
             return utils.get_gzipped_name(result)
     return result
def accepts_gzip(request):

    """
    defines ACCEPTS_GZIP -- a boolean which reflects whether
    the request accepts Content-Type: gzip.

    """

    return {"ACCEPTS_GZIP": utils.accepts_gzip(request)}