Skip to content

Gutenlypso: Set allowed MIME types - #29743

Merged
mmtr merged 1 commit into
masterfrom
fix/gutenlypso-allowed-mime-types
Dec 26, 2018
Merged

mmtr merged 1 commit into
masterfrom
fix/gutenlypso-allowed-mime-types

Conversation

@mmtr

@mmtr mmtr commented Dec 25, 2018

Copy link
Copy Markdown
Member

Changes proposed in this Pull Request

Define in the Gutenberg editor settings the allowed MIME types by the site, so the media blocks (i.e.: audio, block, ...) check them before uploading the media file.

If the file extension doesn't match any of the allowed MIME types, the media block will display an error saying that the file type is not permitted for security reasons.

Fixes #29742

Testing instructions

  1. Switch to a Simple site with a Free plan.
  2. If the current editor is still the Classic editor, opt-in to the Block editor.
  3. Start writing a post.
  4. Add a video block, click on the "Upload" button and select a video file.
  5. Check that an error is displayed immediately and no request to the API is performed trying to upload the file (/wp/v2/sites/:site_id/media).

screen shot 2018-12-25 at 11 08 58

  1. Upload the same video by dragging the file directly to the post content.
  2. Make sure again that an error is displayed immediately and no request to the API is performed trying to upload the file (/wp/v2/sites/:site_id/media).
  3. Repeat steps 4-7 with an audio file
  4. Switch now to a Simple site with Premium or Business plan.
  5. Confirm that you can upload any video or audio file either manually or by dragging them to the editor.

@mmtr mmtr added Bug When a feature is broken and / or not performing as intended [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] Media The media screen in Calypso, general media management, or integration with third party media. [Goal] Gutenberg Working towards full integration with Gutenberg labels Dec 25, 2018
@mmtr mmtr self-assigned this Dec 25, 2018
@matticbot

Copy link
Copy Markdown
Contributor

@vindl vindl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! :shipit:

@vindl vindl added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 26, 2018
@mmtr
mmtr merged commit abbd15d into master Dec 26, 2018
@mmtr
mmtr deleted the fix/gutenlypso-allowed-mime-types branch December 26, 2018 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended [Feature] Media The media screen in Calypso, general media management, or integration with third party media. [Goal] Gutenberg Working towards full integration with Gutenberg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gutenlypso: Dragging audio/video files on free plans fails with no notice

3 participants