payload: {"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/24669","repository_url":"https://api.github.com/repos/servo/servo","labels_url":"https://api.github.com/repos/servo/servo/issues/24669/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/24669/comments","events_url":"https://api.github.com/repos/servo/servo/issues/24669/events","html_url":"https://github.com/servo/servo/pull/24669","id":518179315,"node_id":"MDExOlB1bGxSZXF1ZXN0MzM3MTIxODU5","number":24669,"title":"Set response mime_type based on Content-Type","user":{"login":"glowe","id":588088,"node_id":"MDQ6VXNlcjU4ODA4OA==","avatar_url":"https://avatars2.githubusercontent.com/u/588088?v=4","gravatar_id":"","url":"https://api.github.com/users/glowe","html_url":"https://github.com/glowe","followers_url":"https://api.github.com/users/glowe/followers","following_url":"https://api.github.com/users/glowe/following{/other_user}","gists_url":"https://api.github.com/users/glowe/gists{/gist_id}","starred_url":"https://api.github.com/users/glowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glowe/subscriptions","organizations_url":"https://api.github.com/users/glowe/orgs","repos_url":"https://api.github.com/users/glowe/repos","events_url":"https://api.github.com/users/glowe/events{/privacy}","received_events_url":"https://api.github.com/users/glowe/received_events","type":"User","site_admin":false},"labels":[{"id":155503129,"node_id":"MDU6TGFiZWwxNTU1MDMxMjk=","url":"https://api.github.com/repos/servo/servo/labels/S-awaiting-merge","name":"S-awaiting-merge","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"jdm","id":27658,"node_id":"MDQ6VXNlcjI3NjU4","avatar_url":"https://avatars1.githubusercontent.com/u/27658?v=4","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"assignees":[{"login":"jdm","id":27658,"node_id":"MDQ6VXNlcjI3NjU4","avatar_url":"https://avatars1.githubusercontent.com/u/27658?v=4","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2019-11-06T01:24:57Z","updated_at":"2019-11-12T22:55:09Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/24669","html_url":"https://github.com/servo/servo/pull/24669","diff_url":"https://github.com/servo/servo/pull/24669.diff","patch_url":"https://github.com/servo/servo/pull/24669.patch"},"body":"<!-- Please describe your changes on the following line: -->\r\nSet the response's `mime_type` based on its `Content-Type` header whenever `Response::set_headers` is called. This ensures that `mime_type` is always consistent with `Content-Type`. The other reason for going with this approach is it relies on `extract_mime_type`: https://github.com/servo/servo/blob/afbcbf75eaa63ff0eec8fd3858e9155eb8dbadaa/components/script/dom/headers.rs#L260-L261\r\n\r\nBesides the consistency argument, I also expect that we'll update the `extract_mime_type` method to conform with its specification.\r\n\r\nAnother option I explored was adding a `set_mime_type` member to `Response` and calling that with the mime type from `Metadata::content_type` in `FetchResponseListener::process_response`. I decided against this since it expanded the interface of `Response` and didn't have the same benefits of the first option. \r\n\r\nFixes #24628.\r\n\r\n---\r\n<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->\r\n- [x] `./mach build -d` does not report any errors\r\n- [x] `./mach test-tidy` does not report any errors\r\n- [x] These changes fix #24628.\r\n\r\n<!-- Either: -->\r\n- [x] There are tests for these changes\r\n\r\n<!-- Also, please make sure that \"Allow edits from maintainers\" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->\r\n\r\n<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->\r\n"},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/553155215","html_url":"https://github.com/servo/servo/pull/24669#issuecomment-553155215","issue_url":"https://api.github.com/repos/servo/servo/issues/24669","id":553155215,"node_id":"MDEyOklzc3VlQ29tbWVudDU1MzE1NTIxNQ==","user":{"login":"bors-servo","id":4368172,"node_id":"MDQ6VXNlcjQzNjgxNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/4368172?v=4","gravatar_id":"","url":"https://api.github.com/users/bors-servo","html_url":"https://github.com/bors-servo","followers_url":"https://api.github.com/users/bors-servo/followers","following_url":"https://api.github.com/users/bors-servo/following{/other_user}","gists_url":"https://api.github.com/users/bors-servo/gists{/gist_id}","starred_url":"https://api.github.com/users/bors-servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bors-servo/subscriptions","organizations_url":"https://api.github.com/users/bors-servo/orgs","repos_url":"https://api.github.com/users/bors-servo/repos","events_url":"https://api.github.com/users/bors-servo/events{/privacy}","received_events_url":"https://api.github.com/users/bors-servo/received_events","type":"User","site_admin":false},"created_at":"2019-11-12T22:55:09Z","updated_at":"2019-11-12T22:55:09Z","author_association":"CONTRIBUTOR","body":":broken_heart: Test failed - [linux-rel-css](http://build.servo.org/builders/linux-rel-css/builds/14125)"}}
other: {"actor":{"display_login":"bors-servo"}}