Allow only "fit-in" modification with certain sizes for frontend API calls #509
-
Hello, We'd like to use the handler only as a resize service for our website images stored in S3. Since we don't need any other function, is there a way to allow only "fit-in" modification with certain predefined sizes to be accessible via frontend API? E.g., we'd like to allow requests to and block any other modifications like "filters" or "crop" and any other sizes. Could you please explain how to do it correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I have also been looking for this sort of restriction. |
Beta Was this translation helpful? Give feedback.
-
Hi @valeriblack and @bensquire. While this isn't officially supported, you could make the following changes to achieve similar functionality to what you're describing:
This will only parse for the fit in filter
Let me know how it goes, |
Beta Was this translation helpful? Give feedback.
Hi @valeriblack and @bensquire.
While this isn't officially supported, you could make the following changes to achieve similar functionality to what you're describing:
if ( requestType == RequestTypes.DEFAULT)
from/source/image-handler/image-request.ts:260-263
This prevents the user from using anything other than Thumbor style requests (Keep in mind this will break the demo ui)
source/image-handler/thumbor-mapper.ts:19-35
withThis will only parse for the fit in filter