{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Docs/pulls/comments/31178148","id":31178148,"diff_hunk":"@@ -1,8 +1,79 @@\n-.. include:: /stub-topic.txt\n+Specifying a CORS Policy\n+========================\n \n-|stub-icon| Specifying a CORS Policy\n-====================================\n+By `Mike Wasson <https://github.com/MikeWasson>`_ \n \n-.. include:: /stub-notice.txt\n+Browser security prevents a web page from making AJAX requests to another domain. This restriction is called the *same-origin policy*, and prevents a malicious site from reading sensitive data from another site. However, sometimes you might want to let other sites make cross-origin requests to your web app.\n \n-.. _issue: https://github.com/aspnet/Docs/issues/136\n\\ No newline at end of file\n+`Cross Origin Resource Sharing <http://www.w3.org/TR/cors/>`_ is a W3C standard that allows a server to relax the same-origin policy. Using CORS, a server can explicitly allow some cross-origin requests while rejecting others. This topic shows how to enable CORS in your ASP.NET MVC 6 application. (For background on CORS, see :ref:`cors-how-cors-works`.)\n+\n+\n+Add the CORS package\n+--------------------\n+\n+In your project.json file, add the following:\n+\n+.. literalinclude:: cors-policy/sample/project.json\n+    :language: json\n+    :lines: 5,9-11\n+    :emphasize-lines: 3\n+\n+\n+Configure CORS\n+--------------\n+\n+To configure CORS, call ``ConfigureCors`` in the ``ConfigureServices`` method of your ``Startup`` class, as shown here:\n+\n+.. literalinclude:: cors-policy/sample/Startup.cs","path":"docs/mvc/security/cors-policy.rst","position":33,"original_position":33,"commit_id":"5e03d8f1ee2ded37bcdfe1d429701f3c70475a4f","original_commit_id":"32f6bc6c22b808d6683b4206f4b1323b9e6c1610","user":{"login":"harshgMSFT","id":6729943,"avatar_url":"https://avatars.githubusercontent.com/u/6729943?v=3","gravatar_id":"","url":"https://api.github.com/users/harshgMSFT","html_url":"https://github.com/harshgMSFT","followers_url":"https://api.github.com/users/harshgMSFT/followers","following_url":"https://api.github.com/users/harshgMSFT/following{/other_user}","gists_url":"https://api.github.com/users/harshgMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/harshgMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harshgMSFT/subscriptions","organizations_url":"https://api.github.com/users/harshgMSFT/orgs","repos_url":"https://api.github.com/users/harshgMSFT/repos","events_url":"https://api.github.com/users/harshgMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/harshgMSFT/received_events","type":"User","site_admin":false},"body":"sure","created_at":"2015-05-27T20:43:47Z","updated_at":"2015-05-27T20:43:47Z","html_url":"https://github.com/aspnet/Docs/pull/262#discussion_r31178148","pull_request_url":"https://api.github.com/repos/aspnet/Docs/pulls/262","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/comments/31178148"},"html":{"href":"https://github.com/aspnet/Docs/pull/262#discussion_r31178148"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/262"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Docs/pulls/262","id":35973352,"html_url":"https://github.com/aspnet/Docs/pull/262","diff_url":"https://github.com/aspnet/Docs/pull/262.diff","patch_url":"https://github.com/aspnet/Docs/pull/262.patch","issue_url":"https://api.github.com/repos/aspnet/Docs/issues/262","number":262,"state":"open","locked":false,"title":"Article on enabling CORS","user":{"login":"MikeWasson","id":3992422,"avatar_url":"https://avatars.githubusercontent.com/u/3992422?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeWasson","html_url":"https://github.com/MikeWasson","followers_url":"https://api.github.com/users/MikeWasson/followers","following_url":"https://api.github.com/users/MikeWasson/following{/other_user}","gists_url":"https://api.github.com/users/MikeWasson/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeWasson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeWasson/subscriptions","organizations_url":"https://api.github.com/users/MikeWasson/orgs","repos_url":"https://api.github.com/users/MikeWasson/repos","events_url":"https://api.github.com/users/MikeWasson/events{/privacy}","received_events_url":"https://api.github.com/users/MikeWasson/received_events","type":"User","site_admin":false},"body":"Issues #94 #136 ","created_at":"2015-05-21T20:21:14Z","updated_at":"2015-05-27T20:43:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65490bf0e04b7fcb3a4d1507ff610d6800f0b057","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Docs/pulls/262/commits","review_comments_url":"https://api.github.com/repos/aspnet/Docs/pulls/262/comments","review_comment_url":"https://api.github.com/repos/aspnet/Docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Docs/issues/262/comments","statuses_url":"https://api.github.com/repos/aspnet/Docs/statuses/5e03d8f1ee2ded37bcdfe1d429701f3c70475a4f","head":{"label":"aspnet:cors","ref":"cors","sha":"5e03d8f1ee2ded37bcdfe1d429701f3c70475a4f","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":28239455,"name":"Docs","full_name":"aspnet/Docs","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/Docs","description":"Documentation for ASP.NET 5","fork":false,"url":"https://api.github.com/repos/aspnet/Docs","forks_url":"https://api.github.com/repos/aspnet/Docs/forks","keys_url":"https://api.github.com/repos/aspnet/Docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Docs/teams","hooks_url":"https://api.github.com/repos/aspnet/Docs/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Docs/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Docs/events","assignees_url":"https://api.github.com/repos/aspnet/Docs/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Docs/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Docs/tags","blobs_url":"https://api.github.com/repos/aspnet/Docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Docs/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Docs/languages","stargazers_url":"https://api.github.com/repos/aspnet/Docs/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Docs/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Docs/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Docs/subscription","commits_url":"https://api.github.com/repos/aspnet/Docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Docs/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Docs/merges","archive_url":"https://api.github.com/repos/aspnet/Docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Docs/downloads","issues_url":"https://api.github.com/repos/aspnet/Docs/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Docs/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Docs/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Docs/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Docs/releases{/id}","created_at":"2014-12-19T17:38:02Z","updated_at":"2015-05-27T05:54:51Z","pushed_at":"2015-05-27T18:24:43Z","git_url":"git://github.com/aspnet/Docs.git","ssh_url":"git@github.com:aspnet/Docs.git","clone_url":"https://github.com/aspnet/Docs.git","svn_url":"https://github.com/aspnet/Docs","homepage":null,"size":20350,"stargazers_count":95,"watchers_count":95,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":71,"mirror_url":null,"open_issues_count":148,"forks":71,"open_issues":148,"watchers":95,"default_branch":"master"}},"base":{"label":"aspnet:master","ref":"master","sha":"f664c8d819bbd8d92256ed684d42d6c055b455e3","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":28239455,"name":"Docs","full_name":"aspnet/Docs","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/Docs","description":"Documentation for ASP.NET 5","fork":false,"url":"https://api.github.com/repos/aspnet/Docs","forks_url":"https://api.github.com/repos/aspnet/Docs/forks","keys_url":"https://api.github.com/repos/aspnet/Docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Docs/teams","hooks_url":"https://api.github.com/repos/aspnet/Docs/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Docs/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Docs/events","assignees_url":"https://api.github.com/repos/aspnet/Docs/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Docs/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Docs/tags","blobs_url":"https://api.github.com/repos/aspnet/Docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Docs/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Docs/languages","stargazers_url":"https://api.github.com/repos/aspnet/Docs/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Docs/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Docs/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Docs/subscription","commits_url":"https://api.github.com/repos/aspnet/Docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Docs/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Docs/merges","archive_url":"https://api.github.com/repos/aspnet/Docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Docs/downloads","issues_url":"https://api.github.com/repos/aspnet/Docs/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Docs/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Docs/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Docs/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Docs/releases{/id}","created_at":"2014-12-19T17:38:02Z","updated_at":"2015-05-27T05:54:51Z","pushed_at":"2015-05-27T18:24:43Z","git_url":"git://github.com/aspnet/Docs.git","ssh_url":"git@github.com:aspnet/Docs.git","clone_url":"https://github.com/aspnet/Docs.git","svn_url":"https://github.com/aspnet/Docs","homepage":null,"size":20350,"stargazers_count":95,"watchers_count":95,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":71,"mirror_url":null,"open_issues_count":148,"forks":71,"open_issues":148,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/262"},"html":{"href":"https://github.com/aspnet/Docs/pull/262"},"issue":{"href":"https://api.github.com/repos/aspnet/Docs/issues/262"},"comments":{"href":"https://api.github.com/repos/aspnet/Docs/issues/262/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/262/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/262/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Docs/statuses/5e03d8f1ee2ded37bcdfe1d429701f3c70475a4f"}}}}