Skip to content

fix(elbv2): dropInvalidHeaderFields not reflected in CloudFormation when set to false#37373

Open
syukawa-gh wants to merge 1 commit intoaws:mainfrom
syukawa-gh:fix/elbv2-drop-invalid-headers-false
Open

fix(elbv2): dropInvalidHeaderFields not reflected in CloudFormation when set to false#37373
syukawa-gh wants to merge 1 commit intoaws:mainfrom
syukawa-gh:fix/elbv2-drop-invalid-headers-false

Conversation

@syukawa-gh
Copy link
Copy Markdown
Contributor

Reason for this change

When dropInvalidHeaderFields is explicitly set to false, the attribute is omitted from the CloudFormation template. This prevents rolling back the setting from true to false.

Closes #36409

Description of changes

Change if (props.dropInvalidHeaderFields) to if (props.dropInvalidHeaderFields !== undefined) so that both true and false values are included in the template, matching the pattern used by http2Enabled.

Description of how you validated changes

Added a unit test that verifies the attribute is present in the template when set to false.

Checklist

When `dropInvalidHeaderFields` is explicitly set to `false`, the
attribute was omitted from the CloudFormation template because the
condition `if (props.dropInvalidHeaderFields)` evaluates to false.

Change the check to `!== undefined` so that both `true` and `false`
values are included in the template.

Closes aws#36409
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Mar 27, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team March 27, 2026 08:43
@syukawa-gh
Copy link
Copy Markdown
Contributor Author

Exemption Request: This PR fixes a one-line condition check and adds a unit test. Integration test is not applicable as this is a load balancer attribute change that doesn't affect CloudFormation resource structure.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Mar 27, 2026
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

✅ A exemption request has been requested. Please wait for a maintainer's review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-elasticloadbalancingv2): dropInvalidHeaderFields not reflected in CloudFormation when set from true to false

3 participants