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

Unexpected behavior after adding support for images without extension #307

Closed
2 of 6 tasks
eortiz-tracktik opened this issue Oct 8, 2021 · 2 comments
Closed
2 of 6 tasks
Labels

Comments

@eortiz-tracktik
Copy link

eortiz-tracktik commented Oct 8, 2021

Describe the bug
If for some reason the request is on the Default (base64 encoded JSON) and it get truncated making the JSON invalid, ImageRequest.parseRequestType() will return Thumbor instead of throwing a 400 RequestTypeError, (the new regular expression for matchThumbor added on version v5.2.0 will match the truncated Base64 encoded request)
This will produce at the end a 404 error on the final response, because it will try to find an image that doesn't exists using the first configured bucket and the truncated request as the key.

To Reproduce
truncated/incomplete Default request type:
GET https://serverless-image-handler.your-server.com/eyJidWNrZXQiOiJidWNrZXQiLCJrZXkiOiJpbWFnZS5wbmciLCJlZGl0cyI6eyJyZXNpemUi
Response: 404 Not Found

Expected behavior
Response: 400 RequestTypeError

Please complete the following information about the solution:

  • Version: v5.2.0
  • Region: all
  • Was the solution modified from the version published on this repository?
  • If the answer to the previous question was yes, are the changes available on GitHub?
  • Have you checked your service quotas for the sevices this solution uses?
  • Were there any errors in the CloudWatch Logs?

Screenshots

Additional context

@gattasrikanth
Copy link

Thanks for reporting the issue. We are looking into this issue.

@fisenkodv
Copy link
Contributor

@eortiz-tracktik we have updated our solution, the issue has been fixed. If you still see the issue with the latest version (v6.0.0), please feel free to reopen the issue.

You can refer to the recent changes here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants