{"action":"opened","number":29743,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/29743","id":240859397,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwODU5Mzk3","html_url":"https://github.com/Automattic/wp-calypso/pull/29743","diff_url":"https://github.com/Automattic/wp-calypso/pull/29743.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/29743.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/29743","number":29743,"state":"open","locked":false,"title":"Gutenlypso: Set allowed MIME types","user":{"login":"mmtr","id":1233880,"node_id":"MDQ6VXNlcjEyMzM4ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/1233880?v=4","gravatar_id":"","url":"https://api.github.com/users/mmtr","html_url":"https://github.com/mmtr","followers_url":"https://api.github.com/users/mmtr/followers","following_url":"https://api.github.com/users/mmtr/following{/other_user}","gists_url":"https://api.github.com/users/mmtr/gists{/gist_id}","starred_url":"https://api.github.com/users/mmtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmtr/subscriptions","organizations_url":"https://api.github.com/users/mmtr/orgs","repos_url":"https://api.github.com/users/mmtr/repos","events_url":"https://api.github.com/users/mmtr/events{/privacy}","received_events_url":"https://api.github.com/users/mmtr/received_events","type":"User","site_admin":false},"body":"#### Changes proposed in this Pull Request\r\n\r\nDefine 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. \r\n\r\nIf 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. \r\n\r\nFixes #29742\r\n\r\n#### Testing instructions\r\n\r\n<!--\r\nAdd as many details as possible to help others reproduce the issue and test the fix.\r\n\"Before / After\" screenshots can also be very helpful when the change is visual.\r\n-->\r\n\r\n1. Switch to a Simple site with a Free plan.\r\n2. If the current editor is still the Classic editor, opt-in to the Block editor.\r\n3. Start writing a post.\r\n4. Add a video block, click on the \"Upload\" button and select a video file.\r\n5. 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`).\r\n<img width=\"602\" alt=\"screen shot 2018-12-25 at 11 08 58\" src=\"https://user-images.githubusercontent.com/1233880/50420233-7faf6200-0835-11e9-9974-8b54393f52c0.png\">\r\n\r\n\r\n6. Upload the same video by dragging the file directly to the post content.\r\n7. 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`).\r\n8. Repeat steps 4-7 with an audio file\r\n9. Switch now to a Simple site with Premium or Business plan.\r\n10. Confirm that you can upload any video or audio file either manually or by dragging them to the editor.\r\n\r\n\r\n","created_at":"2018-12-25T10:10:03Z","updated_at":"2018-12-25T10:10:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"mmtr","id":1233880,"node_id":"MDQ6VXNlcjEyMzM4ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/1233880?v=4","gravatar_id":"","url":"https://api.github.com/users/mmtr","html_url":"https://github.com/mmtr","followers_url":"https://api.github.com/users/mmtr/followers","following_url":"https://api.github.com/users/mmtr/following{/other_user}","gists_url":"https://api.github.com/users/mmtr/gists{/gist_id}","starred_url":"https://api.github.com/users/mmtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmtr/subscriptions","organizations_url":"https://api.github.com/users/mmtr/orgs","repos_url":"https://api.github.com/users/mmtr/repos","events_url":"https://api.github.com/users/mmtr/events{/privacy}","received_events_url":"https://api.github.com/users/mmtr/received_events","type":"User","site_admin":false},"assignees":[{"login":"mmtr","id":1233880,"node_id":"MDQ6VXNlcjEyMzM4ODA=","avatar_url":"https://avatars2.githubusercontent.com/u/1233880?v=4","gravatar_id":"","url":"https://api.github.com/users/mmtr","html_url":"https://github.com/mmtr","followers_url":"https://api.github.com/users/mmtr/followers","following_url":"https://api.github.com/users/mmtr/following{/other_user}","gists_url":"https://api.github.com/users/mmtr/gists{/gist_id}","starred_url":"https://api.github.com/users/mmtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmtr/subscriptions","organizations_url":"https://api.github.com/users/mmtr/orgs","repos_url":"https://api.github.com/users/mmtr/repos","events_url":"https://api.github.com/users/mmtr/events{/privacy}","received_events_url":"https://api.github.com/users/mmtr/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":285010038,"node_id":"MDU6TGFiZWwyODUwMTAwMzg=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Media","name":"Media","color":"006b75","default":false},{"id":967391996,"node_id":"MDU6TGFiZWw5NjczOTE5OTY=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Goal]%20Gutenberg","name":"[Goal] Gutenberg","color":"97f4d2","default":false},{"id":285010018,"node_id":"MDU6TGFiZWwyODUwMTAwMTg=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false},{"id":285009975,"node_id":"MDU6TGFiZWwyODUwMDk5NzU=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Type]%20Bug","name":"[Type] Bug","color":"e11d21","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/29743/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/29743/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/29743/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/8cc098074a594601cbe117f37a6bb14b28c27c51","head":{"label":"Automattic:fix/gutenlypso-allowed-mime-types","ref":"fix/gutenlypso-allowed-mime-types","sha":"8cc098074a594601cbe117f37a6bb14b28c27c51","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"node_id":"MDEwOlJlcG9zaXRvcnk0NTkzNjg5NQ==","name":"wp-calypso","full_name":"Automattic/wp-calypso","private":false,"owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Automattic/wp-calypso","description":"The JavaScript and API powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2018-12-25T04:16:07Z","pushed_at":"2018-12-25T09:54:57Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":127991,"stargazers_count":10702,"watchers_count":10702,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1520,"mirror_url":null,"archived":false,"open_issues_count":1768,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":1520,"open_issues":1768,"watchers":10702,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"8d6b6237b4c7b605d46eb6fa0176198b25785d89","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"node_id":"MDEwOlJlcG9zaXRvcnk0NTkzNjg5NQ==","name":"wp-calypso","full_name":"Automattic/wp-calypso","private":false,"owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Automattic/wp-calypso","description":"The JavaScript and API powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2018-12-25T04:16:07Z","pushed_at":"2018-12-25T09:54:57Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":127991,"stargazers_count":10702,"watchers_count":10702,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1520,"mirror_url":null,"archived":false,"open_issues_count":1768,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":1520,"open_issues":1768,"watchers":10702,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/29743"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/29743"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/29743"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/29743/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/29743/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/29743/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/8cc098074a594601cbe117f37a6bb14b28c27c51"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":16,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"mmtr"}}