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

Fix/do 1660 update viewer protocol policy #1376

Merged
merged 4 commits into from
May 23, 2024

Conversation

crispy101
Copy link
Contributor

Description of the proposed changes

  • DO-1660: specify viewer protocol policy to be REDIRECT_TO_HTTPS
  • DO-1661: make "to" path in remap optional

Screenshots (if applicable)

Other solutions considered (if any)

Notes to PR author

⚠️ Please make sure the changes adhere to the guidelines mentioned here

Notes to reviewers

🛈 When you've finished leaving feedback, please add a final comment to the PR tagging the author, letting them know that you have finished leaving feedback

@crispy101 crispy101 requested review from TheOrangePuff, gowrizrh and a user May 23, 2024 04:11
Copy link
Contributor

@TheOrangePuff TheOrangePuff left a comment

Choose a reason for hiding this comment

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

Minor change but looks good otherwise

const lambdas: EdgeLambda[] = [];

// If the remap is to a different path, create a Lambda@Edge function to handle this
// Remove special characters from path
if (from.replace(/\*$/, "") !== to) {
if (from.replace(/\*$/, "") !== to && to) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you flip these conditions around so it checks if to is falsey first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, done.

@crispy101 crispy101 merged commit 4d4e503 into main May 23, 2024
1 check passed
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