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

feat(rewrite-pattern): multiple rewrite pattern and substitution support #418

Closed
wants to merge 17 commits into from

Conversation

dougtoppin
Copy link
Contributor

Description of changes:

Contains enhanced changes from PR #399 where support added for multiple rewrite pattern and substitution entries.

REWRITE_MATCH_PATTERN and REWRITE_SUBSTITUTION values can be written like JSON Arrays.
So multiple rewrite rules can be applied.

For example;
REWRITE_MATCH_PATTERN:
["//thumb/g","//small/g","//large/g"]

REWRITE_SUBSTITUTION:
["/300x300/filters:quality(80)","/fit-in/600x600/filters:quality(80)","/fit-in/1200x1200/filters:quality(80)"]

Changes:

  • image-request and thumbor-mapper changes for multiple rewrite/substitution entries
  • common functions in PR moved to solution-utils/helpers
  • unit test support added for solution-utils/helpers

Checklist

  • 👋 I have run the unit tests, and all unit tests have passed.
  • ⚠️ This pull request might incur a breaking change.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dougtoppin dougtoppin requested a review from a team January 3, 2023 20:07
@dougtoppin
Copy link
Contributor Author

This will require additions to the Implementation Guide listing the capability and providing example usages which will be submitted separately

try {
return JSON.parse(str);
} catch (e) {
return [str];
Copy link
Member

Choose a reason for hiding this comment

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

returning array?

@dougtoppin dougtoppin closed this Jan 13, 2023
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