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

Fixed #9299: Use correct SVG MIME type for uploads #9300

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

elyscape
Copy link
Contributor

The correct MIME type of SVG is image/svg+xml. Out of an abundance of caution, I am leaving in image/svg to avoid potentially causing issues on very old browsers, but this can likely be removed without issue.

Description

When given an <input> tag of type file, browsers limit which files you can upload based on a list of MIME types provided in the accept attribute. We currently specify image/svg instead of image/svg+xml and, as a result, current browsers will not allow users to upload SVG files to Snipe-IT. This resolves that by adding image/svg+xml to the list of accepted MIME types.

Fixes #9299

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Attempt to upload an SVG image without this patch
  • Attempt to upload an SVG image with this patch

Checklist:

The correct MIME type of SVG is image/svg+xml. Out of an abundance of
caution, I am leaving in image/svg to avoid potentially causing issues
on very old browsers, but this can likely be removed without issue.
@elyscape elyscape requested a review from snipe as a code owner March 15, 2021 23:17
@welcome
Copy link

welcome bot commented Mar 15, 2021

💖 Thanks for this pull request! 💖

We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already.

Examples of commit messages with semantic prefixes:

  • Fixed #<issue number>: don't overwrite prevent_default if default wasn't prevented
  • Added #<issue number>: add checkout functionality to assets
  • Improved Asset Checkout: use new notification method for checkout

Things that will help get your PR across the finish line:

  • Document any user-facing changes you've made.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@elyscape elyscape changed the title Fixes #9299: Use correct SVG MIME type for uploads Fixed #9299: Use correct SVG MIME type for uploads Mar 15, 2021
@snipe snipe changed the base branch from master to develop March 15, 2021 23:40
@snipe snipe merged commit 97fa966 into snipe:develop Mar 15, 2021
@welcome
Copy link

welcome bot commented Mar 15, 2021

Congrats on merging your first pull request! 🎉🎉🎉

@snipe
Copy link
Owner

snipe commented Mar 15, 2021

I retargeted this to develop, per our contributing documentation and it's been merged - thanks!
SealOfApproval

@elyscape elyscape deleted the fix-svg-upload branch March 16, 2021 00:13
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.

SVG images cannot be uploaded
2 participants