parameters: (request, signature_version, region_name,
                  default_endpoint_url=None, **kwargs)
docstring: This handler looks at S3 requests just before they are signed.
      If there is a bucket name on the path (true for everything except
      ListAllBuckets) it checks to see if that bucket name conforms to
      the DNS naming conventions.  If it does, it alters the request to
      use ``virtual hosting`` style addressing rather than ``path-style``
      addressing.
docstring_summary: This handler looks at S3 requests just before they are signed.
      If there is a bucket name on the path (true for everything except
      ListAllBuckets) it checks to see if that bucket name conforms to
      the DNS naming conventions.  If it does, it alters the request to
      use ``virtual hosting`` style addressing rather than ``path-style``
      addressing.
docstring_tokens: This handler looks at S3 requests just before they are signed . If there is a bucket name on the path ( true for everything except ListAllBuckets ) it checks to see if that bucket name conforms to the DNS naming conventions . If it does it alters the request to use virtual hosting style addressing rather than path - style addressing .
function: def fix_s3_host(request, signature_version, region_name,
                  default_endpoint_url=None, **kwargs):
      """
      This handler looks at S3 requests just before they are signed.
      If there is a bucket name on the path (true for everything except
      ListAllBuckets) it checks to see if that bucket name conforms to
      the DNS naming conventions.  If it does, it alters the request to
      use ``virtual hosting`` style addressing rather than ``path-style``
      addressing.
  
      """
      if request.context.get('use_global_endpoint', False):
          default_endpoint_url = 's3.amazonaws.com'
      try:
          switch_to_virtual_host_style(
              request, signature_version, default_endpoint_url)
      except InvalidDNSNameError as e:
          bucket_name = e.kwargs['bucket_name']
          logger.debug('Not changing URI, bucket is not DNS compatible: %s',
                       bucket_name)
function_tokens: def fix_s3_host ( request , signature_version , region_name , default_endpoint_url = None , * * kwargs ) : if request . context . get ( 'use_global_endpoint' , False ) : default_endpoint_url = 's3.amazonaws.com' try : switch_to_virtual_host_style ( request , signature_version , default_endpoint_url ) except InvalidDNSNameError as e : bucket_name = e . kwargs [ 'bucket_name' ] logger . debug ( 'Not changing URI, bucket is not DNS compatible: %s' , bucket_name )