### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

When folder names contain a space then `listObjects` returns names without `/` at the end. Without space it works fine.

### Expected Behavior

Folders containing space in the name are returned with `/` at the end.

### How are you starting LocalStack?

With a `docker run` command

### Steps To Reproduce

awslocal s3api put-object --bucket bucket-name --key "folder name/"

awslocal s3api list-objects --bucket bucket-name
```
{
    "Contents": [
        {
            "Key": "folder name",
            "LastModified": "2023-12-11T10:15:20.000Z",
            "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
            "Size": 0,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "webfile",
                "ID": "75aa57f09aa0c8caeab4f8c24e99d10f8e7faeebf76c078efc7c6caea54ba06a"
            }
        }
    ],
    "RequestCharged": null
}
```


### Environment

```markdown
- OS: Linux Mint 21.2
- LocalStack: localstack/localstack:3.0
```


### Anything else?

_No response_
)
        custom_hostname = "foobar"
        monkeypatch.setattr(
            config,
            "LOCALSTACK_HOST",
            config.HostAndPort(host=custom_hostname, port=config.GATEWAY_LISTEN[0].port),
        )
        key = "test.file"
        content = "test content 123"
        acl = "public-read"
        # uplo
        response = s3_multipart_upload(bucket=s3_bucket, key=key, data=content, acl=acl)
        snapshot.match("multipart-upload", response)
        expected_url = (
            f"{_bucket_url(bucket_name=s3_bucket, localstack_host=custom_hostname)}/{key}"
        )
        assert response["Location"] == expected_url
        # down
        downloaded_ = aws_client.s3.get_(Bucket=s3_bucket, Key=key)
        snapshot.match("get-", response)
        assert content == to_str(downloaded_["Body"].read())
        # down
        download_url = response["Location"].replace(
            f"{get_localstack_host().host}:", "localhost.localstack.cloud:"
        )
        response = .get(download_url)
        assert response.status_code == 200
        assert to_str(response.content) == content
    @markers.aws.only_localstack
    def test_s3_hostname_with_subdomain(self, aws_http_client_factory, aws_client):