def test_s3_get_response_content_type_same_as_upload_and_range(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    object_key = '/foo/bar/key-by-hostname'
    content_type = 'foo/bar; charset=utf-8'
    client.put_object(Bucket=bucket_name, Key=object_key, Body=('something ' * 20), ContentType=content_type)
    url = client.generate_presigned_url('get_object', Params={'Bucket': bucket_name, 'Key': object_key})
    response = requests.get(url, verify=False)
    self.assertEqual(response.headers['content-type'], content_type)
    response = requests.get(url, headers={'Range': 'bytes=0-18'}, verify=False)
    self.assertEqual(response.headers['content-type'], content_type)
    self.assertEqual(to_str(response.content), 'something something')
    self._delete_bucket(bucket_name, [object_key])
def test_s3_get_response_content_type_same_as_upload_and_range(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    object_key = '/foo/bar/key-by-hostname'
    content_type = 'foo/bar; charset=utf-8'
    client.put_object(Bucket=bucket_name, Key=object_key, Body=('something ' * 20), ContentType=content_type)
    url = client.generate_presigned_url('get_object', Params={'Bucket': bucket_name, 'Key': object_key})
    response = requests.get(url, verify=False)
    self.assertEqual(response.headers['content-type'], content_type)
    response = requests.get(url, headers={'Range': 'bytes=0-18'}, verify=False)
    self.assertEqual(response.headers['content-type'], content_type)
    self.assertEqual(to_str(response.content), 'something something')
    self._delete_bucket(bucket_name, [object_key])