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

More explicit error messages when uploading corrupt images #3249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

db3000
Copy link

@db3000 db3000 commented Dec 16, 2024

Fixes #3151

Uploading an attachment using com.atproto.repo.uploadBlob will fail with a 500 Internal Server Error if the contents of the upload has the signature of an image (as determined by sharp via ImageMagick) but is not fully parsable as the corresponding image type.

While it is possible to handle such uploads by silencing this error, this PR errs on the side of caution and continues to reject corrupted images but with a more explicit error. It seems to me that the risk of allowing people to upload malformed images outweighs the benefit of more flexible uploads. I can change the code to silently accept such uploads though if that is desirable instead.

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.

Can't upload text/html blob with contents that contain "<svg" + any character
1 participant