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

Fix: Handle invalid thumbnails #432

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

martastain
Copy link
Member

No description provided.

@martastain martastain linked an issue Nov 12, 2024 that may be closed by this pull request
@martastain martastain self-assigned this Nov 12, 2024
@martastain martastain added the type: bug Something isn't working label Nov 12, 2024
@martastain martastain merged commit 9d11634 into develop Nov 13, 2024
@@ -83,12 +84,17 @@ async def store_thumbnail(
MAX_THUMBNAIL_WIDTH = 600
MAX_THUMBNAIL_HEIGHT = 600

if guess_mime_type(payload) != mime:
raise BadRequestException("Mime type does not match the payload")
Copy link
Contributor

Choose a reason for hiding this comment

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

It could be nice - if this could report in the response what the mismatch was. Like what payload it received and what mime it expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate thumbnails upon uploading
2 participants