{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Mvc/pulls/comments/49113217","id":49113217,"diff_hunk":"@@ -283,21 +283,22 @@ public virtual void WriteResponseHeaders(OutputFormatterWriteContext context)\n         /// <returns>The mediaType with the given encoding.</returns>\n         protected string GetMediaTypeWithCharset(string mediaType, Encoding encoding)\n         {\n-            var mediaTypeEncoding = MediaTypeEncoding.GetEncoding(mediaType);\n-            if (mediaTypeEncoding != null &&\n-                mediaTypeEncoding.WebName.Equals(encoding.WebName, StringComparison.OrdinalIgnoreCase))\n+            if (mediaType == null)\n             {\n-                return mediaType;\n+                throw new ArgumentNullException(nameof(mediaType));\n             }\n-            else\n+\n+            if (encoding == null)\n             {\n-                if (encoding.WebName.Equals(Encoding.UTF8.WebName, StringComparison.OrdinalIgnoreCase))\n-                {\n-                    return OutputMediaTypeCache[mediaType];\n-                }\n+                throw new ArgumentNullException(nameof(encoding));\n+            }\n \n-                return MediaTypeEncoding.ReplaceEncoding(mediaType, encoding);\n+            if (encoding.WebName.Equals(Encoding.UTF8.WebName, StringComparison.OrdinalIgnoreCase))\n+            {\n+                return OutputMediaTypeCache[mediaType];","path":"src/Microsoft.AspNet.Mvc.Core/Formatters/OutputFormatter.cs","position":26,"original_position":26,"commit_id":"e0d3f26b344e1fc1902cdf549e6ae857b145d3be","original_commit_id":"e0d3f26b344e1fc1902cdf549e6ae857b145d3be","user":{"login":"rynowak","id":1430011,"avatar_url":"https://avatars.githubusercontent.com/u/1430011?v=3","gravatar_id":"","url":"https://api.github.com/users/rynowak","html_url":"https://github.com/rynowak","followers_url":"https://api.github.com/users/rynowak/followers","following_url":"https://api.github.com/users/rynowak/following{/other_user}","gists_url":"https://api.github.com/users/rynowak/gists{/gist_id}","starred_url":"https://api.github.com/users/rynowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rynowak/subscriptions","organizations_url":"https://api.github.com/users/rynowak/orgs","repos_url":"https://api.github.com/users/rynowak/repos","events_url":"https://api.github.com/users/rynowak/events{/privacy}","received_events_url":"https://api.github.com/users/rynowak/received_events","type":"User","site_admin":false},"body":"Should we just make the cache part of `ReplaceEncoding`?","created_at":"2016-01-07T19:19:13Z","updated_at":"2016-01-07T19:19:13Z","html_url":"https://github.com/aspnet/Mvc/pull/3864#discussion_r49113217","pull_request_url":"https://api.github.com/repos/aspnet/Mvc/pulls/3864","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/comments/49113217"},"html":{"href":"https://github.com/aspnet/Mvc/pull/3864#discussion_r49113217"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/3864"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Mvc/pulls/3864","id":55048015,"html_url":"https://github.com/aspnet/Mvc/pull/3864","diff_url":"https://github.com/aspnet/Mvc/pull/3864.diff","patch_url":"https://github.com/aspnet/Mvc/pull/3864.patch","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/3864","number":3864,"state":"open","locked":false,"title":"[Issue3683 Part 3] Replace stub with real algorithms","user":{"login":"javiercn","id":6995051,"avatar_url":"https://avatars.githubusercontent.com/u/6995051?v=3","gravatar_id":"","url":"https://api.github.com/users/javiercn","html_url":"https://github.com/javiercn","followers_url":"https://api.github.com/users/javiercn/followers","following_url":"https://api.github.com/users/javiercn/following{/other_user}","gists_url":"https://api.github.com/users/javiercn/gists{/gist_id}","starred_url":"https://api.github.com/users/javiercn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiercn/subscriptions","organizations_url":"https://api.github.com/users/javiercn/orgs","repos_url":"https://api.github.com/users/javiercn/repos","events_url":"https://api.github.com/users/javiercn/events{/privacy}","received_events_url":"https://api.github.com/users/javiercn/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-05T02:24:44Z","updated_at":"2016-01-07T19:19:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eccf62db4436aedcc19b64f62ccb813579945dab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Mvc/pulls/3864/commits","review_comments_url":"https://api.github.com/repos/aspnet/Mvc/pulls/3864/comments","review_comment_url":"https://api.github.com/repos/aspnet/Mvc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/3864/comments","statuses_url":"https://api.github.com/repos/aspnet/Mvc/statuses/e0d3f26b344e1fc1902cdf549e6ae857b145d3be","head":{"label":"aspnet:issue3683part3","ref":"issue3683part3","sha":"e0d3f26b344e1fc1902cdf549e6ae857b145d3be","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":15126429,"name":"Mvc","full_name":"aspnet/Mvc","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Mvc","description":"Model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor.","fork":false,"url":"https://api.github.com/repos/aspnet/Mvc","forks_url":"https://api.github.com/repos/aspnet/Mvc/forks","keys_url":"https://api.github.com/repos/aspnet/Mvc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Mvc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Mvc/teams","hooks_url":"https://api.github.com/repos/aspnet/Mvc/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Mvc/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Mvc/events","assignees_url":"https://api.github.com/repos/aspnet/Mvc/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Mvc/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Mvc/tags","blobs_url":"https://api.github.com/repos/aspnet/Mvc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Mvc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Mvc/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Mvc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Mvc/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Mvc/languages","stargazers_url":"https://api.github.com/repos/aspnet/Mvc/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Mvc/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Mvc/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Mvc/subscription","commits_url":"https://api.github.com/repos/aspnet/Mvc/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Mvc/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Mvc/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Mvc/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Mvc/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Mvc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Mvc/merges","archive_url":"https://api.github.com/repos/aspnet/Mvc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Mvc/downloads","issues_url":"https://api.github.com/repos/aspnet/Mvc/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Mvc/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Mvc/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Mvc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Mvc/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Mvc/releases{/id}","created_at":"2013-12-12T03:54:00Z","updated_at":"2016-01-07T16:18:32Z","pushed_at":"2016-01-07T19:15:37Z","git_url":"git://github.com/aspnet/Mvc.git","ssh_url":"git@github.com:aspnet/Mvc.git","clone_url":"https://github.com/aspnet/Mvc.git","svn_url":"https://github.com/aspnet/Mvc","homepage":"","size":26706,"stargazers_count":2599,"watchers_count":2599,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1020,"mirror_url":null,"open_issues_count":269,"forks":1020,"open_issues":269,"watchers":2599,"default_branch":"dev"}},"base":{"label":"aspnet:issue3683part2","ref":"issue3683part2","sha":"d312e82f8356b0afcb0c312dbf93e77b1fa13051","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":15126429,"name":"Mvc","full_name":"aspnet/Mvc","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Mvc","description":"Model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor.","fork":false,"url":"https://api.github.com/repos/aspnet/Mvc","forks_url":"https://api.github.com/repos/aspnet/Mvc/forks","keys_url":"https://api.github.com/repos/aspnet/Mvc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Mvc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Mvc/teams","hooks_url":"https://api.github.com/repos/aspnet/Mvc/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Mvc/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Mvc/events","assignees_url":"https://api.github.com/repos/aspnet/Mvc/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Mvc/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Mvc/tags","blobs_url":"https://api.github.com/repos/aspnet/Mvc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Mvc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Mvc/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Mvc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Mvc/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Mvc/languages","stargazers_url":"https://api.github.com/repos/aspnet/Mvc/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Mvc/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Mvc/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Mvc/subscription","commits_url":"https://api.github.com/repos/aspnet/Mvc/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Mvc/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Mvc/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Mvc/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Mvc/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Mvc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Mvc/merges","archive_url":"https://api.github.com/repos/aspnet/Mvc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Mvc/downloads","issues_url":"https://api.github.com/repos/aspnet/Mvc/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Mvc/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Mvc/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Mvc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Mvc/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Mvc/releases{/id}","created_at":"2013-12-12T03:54:00Z","updated_at":"2016-01-07T16:18:32Z","pushed_at":"2016-01-07T19:15:37Z","git_url":"git://github.com/aspnet/Mvc.git","ssh_url":"git@github.com:aspnet/Mvc.git","clone_url":"https://github.com/aspnet/Mvc.git","svn_url":"https://github.com/aspnet/Mvc","homepage":"","size":26706,"stargazers_count":2599,"watchers_count":2599,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1020,"mirror_url":null,"open_issues_count":269,"forks":1020,"open_issues":269,"watchers":2599,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/3864"},"html":{"href":"https://github.com/aspnet/Mvc/pull/3864"},"issue":{"href":"https://api.github.com/repos/aspnet/Mvc/issues/3864"},"comments":{"href":"https://api.github.com/repos/aspnet/Mvc/issues/3864/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/3864/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/3864/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Mvc/statuses/e0d3f26b344e1fc1902cdf549e6ae857b145d3be"}}}}