-
Notifications
You must be signed in to change notification settings - Fork 4
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
Create CloudFront Function and Origin Request Policy #15
Open
joehoyle
wants to merge
10
commits into
master
Choose a base branch
from
create-function-request-policy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+280
−13
Open
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f2d9210
Create CloudFront Function and Origin Request Policy
joehoyle 2064e0b
Bulk track origin policies
joehoyle 18d97a4
Also batch cloudfront functions
joehoyle 59816cc
Make rate of sites processed a CLI arg so we can easily adjust it to …
Rayhatron e827d6e
Only attempt to create a CloudFront distribution if the site has an A…
Rayhatron 09adf73
Avoid attempting to create a cloudfront distribution for a site that …
Rayhatron 3b1ce35
Allow for bulk unlinking of Cloudfront distributions from sites.
Rayhatron 4b6bc21
Fix delete-cloudfront action not being recognised.
Rayhatron 2b2b0a8
Fix origin request policy
joehoyle 4bcfcba
Fix headers format
joehoyle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function handler(event) { | ||
var request = event.request; | ||
var headers = request.headers; | ||
|
||
// Check if the Host header exists | ||
if (headers.host) { | ||
// Copy the Host header value to the new x-original-host header (lowercase) | ||
headers['x-original-host'] = { | ||
value: headers.host.value | ||
}; | ||
} | ||
|
||
return request; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the cookies list be made filterable to allow for custom cookies to be added to the list when the request policies are created?
I know if that list does ever change then we'd need to either manually update the policy via AWS console or possibly introduce another function for updating policies using the plugin for that use case. Just thinking about that first time policy creation given there can potentially be multiple policies to be created and would be good to have other cookies already included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need the ability to update the policies anyway. Having a filter would be a good idea too yes