Skip to content

Conversation

dougtoppin
Copy link
Contributor

thumbor style requests including a watermark in a folder failed with watermark key not found error.
The parseImageKey regex failed to detect the watermark key correctly due to the embedded slash.
This changes the regex to detect the watermark correctly and includes new unit tests for that case.

Example thumbor style request with watermark in folder/key.png:
/fit-in/400x400/filters:watermark(bucket,folder/key.png,0,0)/image.jpg

Description of changes:

  • image-request/parseImageKey regex addition for watermark inclusion
  • unit tests for image-request, thumbor-mapper to verify watermarks with and without folder

Checklist

  • 👋 I have added unit tests for all code changes.
  • 👋 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 marked this pull request as ready for review January 24, 2023 02:22
Copy link
Member

@CrypticCabub CrypticCabub left a comment

Choose a reason for hiding this comment

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

the CodeQL stuff seems nice to have, though the errors do also make it a little harder to review if they are supposed to be supressed.

@dougtoppin dougtoppin changed the base branch from fix/thumbor-watermark to develop February 14, 2023 01:18
@dougtoppin dougtoppin merged commit 3051d5c into aws-solutions:develop Feb 14, 2023
@dougtoppin dougtoppin deleted the fix/thumbor-watermark branch February 14, 2023 19:38
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.

3 participants