-
Notifications
You must be signed in to change notification settings - Fork 824
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: Use a LoaderResult object to support origin metadata and error handling #554
Conversation
Do you think this PR should also include the fix to return 404 when image not found and 504 otherwise? |
Btw I wish I was half as productive as you are @masom... Thanks for the awesome job! |
It should probably include the 404/504 fix although this means a little bit more refactoring. The |
I agree we should return Value objects, but do you think it would be an acceptable compromise to return a larger array of values for this PR? Maybe we can get this refactor bit in another PR. If you feel you can do it all in the same PR, by all means go for it. I'm just worried that right now thumbor has a security leak (if people keep sending 404 images they can DDOS the server, since the edge caches won't cache it). |
It depends on the edge node configuration. For instance AWS CloudFront will cache 404 / 5xx errors for 5 minutes unless configured otherwise. |
…lt instance instead of an array
The error handling behaviour might have to be changed to match #531 and other PRs/Issues. @guilhermef @heynemann @phoet What do you guys think of this approach? The |
Cool THX. I did not understand why some vows were removed? |
@phoet The deleted vows are a copy of the |
@masom ah ok |
@guilhermef @heynemann OK to merge? |
@masom, It looks really good |
FEAT: Use a LoaderResult object to support origin metadata and error handling
This merge introduce a way for loaders to return metadata and specify error conditions. This will give thumbor a lot more flexibility for dealing with loader errors. The change is backward-compatible with a |
FEAT: Use a LoaderResult object to support origin metadata and error handling
Following a discussion in #529 this PR implements a value object that holds loader response metadata.
Using a value object will allow thumbor to properly respond to upstream failures or errors.