def test_s3_head_response_content_length_same_as_upload(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    body = 'something body \n \n\r'
    object_key = 'key-by-hostname'
    client.put_object(Bucket=bucket_name, Key=object_key, Body=body, ContentType='text/html; charset=utf-8')
    url = client.generate_presigned_url('head_object', Params={'Bucket': bucket_name, 'Key': object_key})
    response = requests.head(url, verify=False)
    self.assertEqual(response.headers['content-length'], str(len(body)))
    self._delete_bucket(bucket_name, [object_key])
def test_s3_head_response_content_length_same_as_upload(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    body = 'something body \n \n\r'
    object_key = 'key-by-hostname'
    client.put_object(Bucket=bucket_name, Key=object_key, Body=body, ContentType='text/html; charset=utf-8')
    url = client.generate_presigned_url('head_object', Params={'Bucket': bucket_name, 'Key': object_key})
    response = requests.head(url, verify=False)
    self.assertEqual(response.headers['content-length'], str(len(body)))
    self._delete_bucket(bucket_name, [object_key])