You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@kurtextrem While it would have been great for AWS to provide a querystring.stringify function for preserving the original query string when responding with a redirect, unfortunately the one they've made available only works on simple objects, e.g.
{
"foo": "bar"
}
If you look at the docs (or just console.log an object in the Cloudfront Function web console) the shape of the querystring object on the request event is:
{
"foo": {
"value: "bar"
}
}
Which does NOT work with the querystring.stringify AWS makes available in their Cloudfront JS 2.0 runtime. You're stuck still having to write your own function.
This file contains hidden or 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.
Issue #, if available:
Closes #11
Description of changes:
This PR includes an example and tests for preserving query strings and url when performing a redirect.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.