When generating a pre-signed URL for download and specifying response-content-disposition to set a target filename, the actual download does not contain the Content-Disposition header therefore the download file does not have the requested filename.

I have confirmed that this works corrected in S3 itself.

I'd be happy to explore a fix if anyone can point me in the right direction/location.
parsed = urlparse.urlparse(path)
    
    bucket_name = parsed.path.split('/')[1]
    host = headers['host']
    
    if host.startswith(HOSTNAME) or host.startswith(HOSTNAME_EXTERNAL):
        return bucket_name
    
    
    
    common_pattern = re.compile(r'^(.+)\.s3[.\-][a-z]{2}-[a-z]+-[0-9]{1,}'
                                r'\.amazonaws\.com(\.[a-z]+)?$')
    
    
    
    dualstack_pattern = re.compile(r'^(.+)\.s3\.dualstack\.[a-z]{2}-[a-z]+-[0-9]{1,}'
                                   r'\.amazonaws\.com(\.[a-z]+)?$')
    
    
    
    legacy_patterns = re.compile(r'^(.+)\.s3\.?(-external-1)?\.amazonaws\.com(\.[a-z]+)?$')
    
    
    for pattern in [common_pattern, dualstack_pattern, legacy_patterns]:
        match = pattern.match(host)
        if match:
            bucket_name = match.groups()[0]
            break