{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Mvc/pulls/comments/205930833","pull_request_review_id":141305557,"id":205930833,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTkzMDgzMw==","diff_hunk":"@@ -67,24 +68,33 @@ public void OnProvidersExecuting(ApplicationModelProviderContext context)\n \n                     if (isCorsEnabledGlobally || corsOnController || corsOnAction)\n                     {\n-                        UpdateHttpMethodActionConstraint(actionModel);\n+                        UpdateActionToAcceptCorsPreflight(actionModel);\n                     }\n                 }\n             }\n         }\n \n-        private static void UpdateHttpMethodActionConstraint(ActionModel actionModel)\n+        private static void UpdateActionToAcceptCorsPreflight(ActionModel actionModel)\n         {\n             for (var i = 0; i < actionModel.Selectors.Count; i++)\n             {\n                 var selectorModel = actionModel.Selectors[i];\n+\n                 for (var j = 0; j < selectorModel.ActionConstraints.Count; j++)\n                 {\n                     if (selectorModel.ActionConstraints[j] is HttpMethodActionConstraint httpConstraint)\n                     {\n                         selectorModel.ActionConstraints[j] = new CorsHttpMethodActionConstraint(httpConstraint);\n                     }\n                 }\n+\n+                for (int j = 0; j < selectorModel.EndpointMetadata.Count; j++)\n+                {\n+                    if (selectorModel.EndpointMetadata[j] is IHttpMethodMetadata httpMethodMetadata)","path":"src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsApplicationModelProvider.cs","position":36,"original_position":36,"commit_id":"9ac51a5b8134f2cc28a5dcd39828cd9ced66ae28","original_commit_id":"9ac51a5b8134f2cc28a5dcd39828cd9ced66ae28","user":{"login":"rynowak","id":1430011,"node_id":"MDQ6VXNlcjE0MzAwMTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1430011?v=4","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":"Yeah, I suggest matching on the exact type.","created_at":"2018-07-28T03:08:54Z","updated_at":"2018-07-28T03:08:54Z","html_url":"https://github.com/aspnet/Mvc/pull/8158#discussion_r205930833","pull_request_url":"https://api.github.com/repos/aspnet/Mvc/pulls/8158","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/comments/205930833"},"html":{"href":"https://github.com/aspnet/Mvc/pull/8158#discussion_r205930833"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/8158"}},"in_reply_to_id":205930645},"pull_request":{"url":"https://api.github.com/repos/aspnet/Mvc/pulls/8158","id":204364525,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MzY0NTI1","html_url":"https://github.com/aspnet/Mvc/pull/8158","diff_url":"https://github.com/aspnet/Mvc/pull/8158.diff","patch_url":"https://github.com/aspnet/Mvc/pull/8158.patch","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/8158","number":8158,"state":"open","locked":false,"title":"Add EndpointMetadata to ActionDescriptor and hookup CORS","user":{"login":"JamesNK","id":303201,"node_id":"MDQ6VXNlcjMwMzIwMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/303201?v=4","gravatar_id":"","url":"https://api.github.com/users/JamesNK","html_url":"https://github.com/JamesNK","followers_url":"https://api.github.com/users/JamesNK/followers","following_url":"https://api.github.com/users/JamesNK/following{/other_user}","gists_url":"https://api.github.com/users/JamesNK/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesNK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesNK/subscriptions","organizations_url":"https://api.github.com/users/JamesNK/orgs","repos_url":"https://api.github.com/users/JamesNK/repos","events_url":"https://api.github.com/users/JamesNK/events{/privacy}","received_events_url":"https://api.github.com/users/JamesNK/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-27T08:33:31Z","updated_at":"2018-07-28T03:08:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eace6f87aa5b1057cd22bcb23b6f8495de5329ae","assignee":null,"assignees":[],"requested_reviewers":[{"login":"kichalla","id":6559784,"node_id":"MDQ6VXNlcjY1NTk3ODQ=","avatar_url":"https://avatars3.githubusercontent.com/u/6559784?v=4","gravatar_id":"","url":"https://api.github.com/users/kichalla","html_url":"https://github.com/kichalla","followers_url":"https://api.github.com/users/kichalla/followers","following_url":"https://api.github.com/users/kichalla/following{/other_user}","gists_url":"https://api.github.com/users/kichalla/gists{/gist_id}","starred_url":"https://api.github.com/users/kichalla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kichalla/subscriptions","organizations_url":"https://api.github.com/users/kichalla/orgs","repos_url":"https://api.github.com/users/kichalla/repos","events_url":"https://api.github.com/users/kichalla/events{/privacy}","received_events_url":"https://api.github.com/users/kichalla/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Mvc/pulls/8158/commits","review_comments_url":"https://api.github.com/repos/aspnet/Mvc/pulls/8158/comments","review_comment_url":"https://api.github.com/repos/aspnet/Mvc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/8158/comments","statuses_url":"https://api.github.com/repos/aspnet/Mvc/statuses/9ac51a5b8134f2cc28a5dcd39828cd9ced66ae28","head":{"label":"aspnet:jamesnk/endpointmetadata-cors","ref":"jamesnk/endpointmetadata-cors","sha":"9ac51a5b8134f2cc28a5dcd39828cd9ced66ae28","user":{"login":"aspnet","id":6476660,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzY2NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEyNjQyOQ==","name":"Mvc","full_name":"aspnet/Mvc","owner":{"login":"aspnet","id":6476660,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzY2NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","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":"ASP.NET Core MVC is a 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}","deployments_url":"https://api.github.com/repos/aspnet/Mvc/deployments","created_at":"2013-12-12T03:54:00Z","updated_at":"2018-07-28T00:19:03Z","pushed_at":"2018-07-28T02:56:29Z","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":70119,"stargazers_count":5479,"watchers_count":5479,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2148,"mirror_url":null,"archived":false,"open_issues_count":207,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2148,"open_issues":207,"watchers":5479,"default_branch":"release/2.2"}},"base":{"label":"aspnet:release/2.2","ref":"release/2.2","sha":"556880872d72e9a38a48283567ed021db08f2905","user":{"login":"aspnet","id":6476660,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzY2NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEyNjQyOQ==","name":"Mvc","full_name":"aspnet/Mvc","owner":{"login":"aspnet","id":6476660,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzY2NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","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":"ASP.NET Core MVC is a 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}","deployments_url":"https://api.github.com/repos/aspnet/Mvc/deployments","created_at":"2013-12-12T03:54:00Z","updated_at":"2018-07-28T00:19:03Z","pushed_at":"2018-07-28T02:56:29Z","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":70119,"stargazers_count":5479,"watchers_count":5479,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2148,"mirror_url":null,"archived":false,"open_issues_count":207,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2148,"open_issues":207,"watchers":5479,"default_branch":"release/2.2"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/8158"},"html":{"href":"https://github.com/aspnet/Mvc/pull/8158"},"issue":{"href":"https://api.github.com/repos/aspnet/Mvc/issues/8158"},"comments":{"href":"https://api.github.com/repos/aspnet/Mvc/issues/8158/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/8158/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Mvc/pulls/8158/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Mvc/statuses/9ac51a5b8134f2cc28a5dcd39828cd9ced66ae28"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"rynowak"}}