Skip to content

Conversation

jhrdina
Copy link

@jhrdina jhrdina commented Feb 10, 2023

This PR adds support for completely removing excluded array indices.

Before

custom: {
    cors: {
        headers: [
            "X-Prod-Specific-Header-1",
            "Normal-Header",
            "X-Prod-Specific-Header-2"
        ]
    }
},

and

Exclude: [
    "custom.cors.headers.0",
    "custom.cors.headers.2",
],

results in

custom: {
    cors: {
        headers: [
            undefined,
            "Normal-Header",
            undefined
        ]
    }
},

After

The result will be

custom: {
    cors: {
        headers: [
            "Normal-Header",
        ]
    }
},

Why

The motivation for this change is that, in our use-case, CloudFormation crashed when it ran into the excluded undefined item in the array. If we remove the item completely, it works as it should.

Note

🧨 BREAKING CHANGE: Exclusion of an array item now removes it completely instead of keeping undefined on its index.

BREAKING CHANGE: Exclusion of an array item now removes it completely instead of keeping
undefined on its index.
@akzincsystems
Copy link

This should also fix this reported issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants