From 24ce10c531c7e28d46ae38e2e418ff7e5a636a12 Mon Sep 17 00:00:00 2001 From: Breland Miley Date: Wed, 22 Aug 2018 15:18:06 -0700 Subject: [PATCH] fix: CloudFront behavior for ViewerProtocolPolicy (#615) This was a typo in the original CloudFront L2 - this just fixes it and updates the tests for it. --- packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts | 2 +- .../test/integ.cloudfront-custom.expected.json | 2 +- .../aws-cloudfront/test/integ.cloudfront.expected.json | 2 +- packages/@aws-cdk/aws-cloudfront/test/test.basic.ts | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index 8f8590018cfc4..8fbb36c82a161 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -22,7 +22,7 @@ export enum PriceClass { */ export enum ViewerProtocolPolicy { HTTPSOnly = "https-only", - RedirectToHTTPS = "https-only", + RedirectToHTTPS = "redirect-to-https", AllowAll = "allow-all" } diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom.expected.json b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom.expected.json index 26de091e6dd63..2ee6693accaef 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom.expected.json +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom.expected.json @@ -21,7 +21,7 @@ "QueryString": false }, "TargetOriginId": "origin1", - "ViewerProtocolPolicy": "https-only" + "ViewerProtocolPolicy": "redirect-to-https" }, "DefaultRootObject": "index.html", "Enabled": true, diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront.expected.json b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront.expected.json index d405bc0f3f1db..e4a24e472126b 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront.expected.json +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront.expected.json @@ -24,7 +24,7 @@ "QueryString": false }, "TargetOriginId": "origin1", - "ViewerProtocolPolicy": "https-only" + "ViewerProtocolPolicy": "redirect-to-https" }, "DefaultRootObject": "index.html", "Enabled": true, diff --git a/packages/@aws-cdk/aws-cloudfront/test/test.basic.ts b/packages/@aws-cdk/aws-cloudfront/test/test.basic.ts index 5541dc82fbc05..92c807f6a7aad 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/test.basic.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/test.basic.ts @@ -53,7 +53,7 @@ export = { "QueryString": false }, "TargetOriginId": "origin1", - "ViewerProtocolPolicy": "https-only" + "ViewerProtocolPolicy": "redirect-to-https" }, "DefaultRootObject": "index.html", "Enabled": true, @@ -150,7 +150,7 @@ export = { "HEAD" ], "TargetOriginId": "origin1", - "ViewerProtocolPolicy": "https-only", + "ViewerProtocolPolicy": "redirect-to-https", "ForwardedValues": { "QueryString": false, "Cookies" : { "Forward" : "none"} @@ -224,7 +224,7 @@ export = { "HEAD" ], "TargetOriginId": "origin1", - "ViewerProtocolPolicy": "https-only", + "ViewerProtocolPolicy": "redirect-to-https", "ForwardedValues": { "QueryString": false, "Cookies" : { "Forward" : "none"}