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

Improve MIME type checks #4610

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Improve MIME type checks #4610

merged 1 commit into from
Jan 10, 2024

Conversation

gjvoosten
Copy link
Collaborator

@gjvoosten gjvoosten commented Dec 20, 2023

If the MIME type suggested by the browser when creating an attachment differs from the detected MIME type based on the uploaded attachment contents, update the MIME type if the detected MIME type is also allowed. This helps with container formats like HEIC/HEIF, where the browser may not be able to accurately guess the actual format based on just the filename extension.

Closes AB#1005

User changes

  • Attachment upload will not fail if the actual MIME type of the uploaded contents is allowed but different from what the user's browser inferred.

Superuser changes

  • None

Admin changes

  • None

System admin changes

  • anet.yml or anet-dictionary.yml needs change
  • db needs migration
  • documentation has changed
  • graphql schema has changed

Checklist

  • Described the user behavior in PR body
  • Referenced/updated all related issues
  • commits follow a repo#issue: Title title format and these 7 rules
  • commits have a clean history, otherwise PR may be squash-merged
  • Added and/or updated unit tests
  • Added and/or updated e2e tests
  • Added and/or updated data migrations
  • Updated documentation
  • Resolved all build errors and warnings
  • Opened debt issues for anything not resolved here

@gjvoosten gjvoosten marked this pull request as ready for review December 20, 2023 15:58
If the MIME type suggested by the browser when creating an attachment
differs from the detected MIME type based on the uploaded attachment contents,
update the MIME type if the detected MIME type is also allowed.
This helps with container formats like HEIC/HEIF, where the browser may
not be able to accurately guess the actual format based on just the
filename extension.
@midmarch midmarch merged commit fc8ccd0 into main Jan 10, 2024
23 checks passed
@midmarch midmarch deleted the AB-1005-improve-mimeType-checks branch January 10, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants