When PUTting an S3 object to Localstack with attached Metadata, if a key contains an underscore it is replaced with a dash.

However, when the same request is performed against the real S3, the key is not modified.

Example Input:
key_with_underscores => test

Localstack Result:
key-with-underscores => test

S3 Result:
key_with_underscores => test

Localstack Version: 0.10.5

Tested using AWS v2 S3 client
parsed = urlparse.urlparse(path)
    path_parts = parsed.path.lstrip('/').split('/', 1)
    if uses_path_addressing(headers):
        return path_parts[1]
    return path_parts[0]
def uses_path_addressing(headers):
    host = headers['host']
    return host.startswith(HOSTNAME) or host.startswith(HOSTNAME_EXTERNAL)
def get_bucket_name(path, headers):
    parsed = urlparse.urlparse(path)
    
    bucket_name = parsed.path.split('/')[1]
    
    if uses_path_addressing(headers):
        return normalize_bucket_name(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]+)?$')