Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/lib/CloudFrontDistributionForApiGateway function bug #30

Closed
beomseoklee opened this issue Jul 29, 2020 · 2 comments
Closed

core/lib/CloudFrontDistributionForApiGateway function bug #30

beomseoklee opened this issue Jul 29, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@beomseoklee
Copy link
Contributor

export function CloudFrontDistributionForApiGateway(scope: cdk.Construct,
apiEndPoint: api.RestApi,
cloudFrontDistributionProps?: cloudfront.CloudFrontWebDistributionProps | any,
httpSecurityHeaders?: boolean): [cloudfront.CloudFrontWebDistribution,
lambda.Version?, s3.Bucket?] {
const _httpSecurityHeaders = httpSecurityHeaders ? httpSecurityHeaders : true;

The above source code has a bug. No matter what parameter is provided to httpSecurityHeader, _httpSecurityHeaders would be true.


This is 🐛 Bug Report

@beomseoklee beomseoklee added bug Something isn't working needs-triage The issue or PR still needs to be triaged labels Jul 29, 2020
@wesselvdv
Copy link

wesselvdv commented Jul 30, 2020

I guess the idea was to do an undefined check. This is currently messing up using this solution for a different region than us-east-1, because the edge lambda association fails.

I suggest we change it to const _httpSecurityHeaders = httpSecurityHeaders !== undefined ? httpSecurityHeaders : true; or if we need to support pre-es5 const _httpSecurityHeaders = typeof httpSecurityHeaders !== 'undefined' ? httpSecurityHeaders : true;

@hnishar hnishar added in-progress This issue is being actively worked on and removed needs-triage The issue or PR still needs to be triaged labels Jul 30, 2020
@hnishar
Copy link
Contributor

hnishar commented Jul 31, 2020

This has been addressed in the latest release v1.54.0

@hnishar hnishar closed this as completed Jul 31, 2020
@hnishar hnishar removed the in-progress This issue is being actively worked on label Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants