{"action":"closed","number":256,"pull_request":{"url":"https://api.github.com/repos/mozilla-services/cornice/pulls/256","id":28204266,"html_url":"https://github.com/mozilla-services/cornice/pull/256","diff_url":"https://github.com/mozilla-services/cornice/pull/256.diff","patch_url":"https://github.com/mozilla-services/cornice/pull/256.patch","issue_url":"https://api.github.com/repos/mozilla-services/cornice/issues/256","number":256,"state":"closed","locked":false,"title":"Empty response to OPTIONS request","user":{"login":"Natim","id":229453,"avatar_url":"https://avatars.githubusercontent.com/u/229453?v=3","gravatar_id":"","url":"https://api.github.com/users/Natim","html_url":"https://github.com/Natim","followers_url":"https://api.github.com/users/Natim/followers","following_url":"https://api.github.com/users/Natim/following{/other_user}","gists_url":"https://api.github.com/users/Natim/gists{/gist_id}","starred_url":"https://api.github.com/users/Natim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Natim/subscriptions","organizations_url":"https://api.github.com/users/Natim/orgs","repos_url":"https://api.github.com/users/Natim/repos","events_url":"https://api.github.com/users/Natim/events{/privacy}","received_events_url":"https://api.github.com/users/Natim/received_events","type":"User","site_admin":false},"body":"While using angular to make POST request I've noticed a warning:\r\n\r\n> 2014-10-12 21:28:12,091 WARNI [cornice][Dummy-2] returning a json string or array is a potential security hole, please ensure you really want to do this.\r\n\r\nAfter some investigation I realised that this is because response to OPTIONS request had an empty body `b'\"\"'`. If I'm not mistaken, angular makes this request before POSTing data. Would it be better if cornice(?) returned an empty object `{}`?\r\n\r\nTo replicate this warning define any resource. Add `cors_origins=('*',)` option, and then make a call, for example, with `curl`:\r\n\r\n> curl -X OPTIONS -H \"Origin:http://localhost:6543/\" -H \"Access-Control-Request-Method:OPTIONS\" localhost:6543/api/v1/notes\r\n\r\nAnd you'll get a warning from cornice.","created_at":"2015-01-28T15:55:42Z","updated_at":"2015-01-28T16:37:57Z","closed_at":"2015-01-28T16:37:57Z","merged_at":"2015-01-28T16:37:57Z","merge_commit_sha":"23b2d53b762d6c09003f321f65fc962a9b63cc1e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/cornice/pulls/256/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/cornice/pulls/256/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/cornice/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-services/cornice/issues/256/comments","statuses_url":"https://api.github.com/repos/mozilla-services/cornice/statuses/5732a0a88cdc71abd760ed8872c0bc5a67383ab6","head":{"label":"mozilla-services:256_remove_warning","ref":"256_remove_warning","sha":"5732a0a88cdc71abd760ed8872c0bc5a67383ab6","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":2562442,"name":"cornice","full_name":"mozilla-services/cornice","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/cornice","description":"restful services for pyramid","fork":false,"url":"https://api.github.com/repos/mozilla-services/cornice","forks_url":"https://api.github.com/repos/mozilla-services/cornice/forks","keys_url":"https://api.github.com/repos/mozilla-services/cornice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/cornice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/cornice/teams","hooks_url":"https://api.github.com/repos/mozilla-services/cornice/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/cornice/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/cornice/events","assignees_url":"https://api.github.com/repos/mozilla-services/cornice/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/cornice/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/cornice/tags","blobs_url":"https://api.github.com/repos/mozilla-services/cornice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/cornice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/cornice/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/cornice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/cornice/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/cornice/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/cornice/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/cornice/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/cornice/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/cornice/subscription","commits_url":"https://api.github.com/repos/mozilla-services/cornice/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/cornice/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/cornice/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/cornice/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-services/cornice/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/cornice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/cornice/merges","archive_url":"https://api.github.com/repos/mozilla-services/cornice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/cornice/downloads","issues_url":"https://api.github.com/repos/mozilla-services/cornice/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/cornice/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/cornice/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/cornice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/cornice/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/cornice/releases{/id}","created_at":"2011-10-12T13:17:51Z","updated_at":"2015-01-28T16:37:58Z","pushed_at":"2015-01-28T16:37:58Z","git_url":"git://github.com/mozilla-services/cornice.git","ssh_url":"git@github.com:mozilla-services/cornice.git","clone_url":"https://github.com/mozilla-services/cornice.git","svn_url":"https://github.com/mozilla-services/cornice","homepage":"http://cornice.rtfd.org","size":1982,"stargazers_count":201,"watchers_count":201,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":45,"forks":97,"open_issues":45,"watchers":201,"default_branch":"master"}},"base":{"label":"mozilla-services:master","ref":"master","sha":"6b57fa929c97ac0b290296613b2f1ab9a454ca3a","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":2562442,"name":"cornice","full_name":"mozilla-services/cornice","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/cornice","description":"restful services for pyramid","fork":false,"url":"https://api.github.com/repos/mozilla-services/cornice","forks_url":"https://api.github.com/repos/mozilla-services/cornice/forks","keys_url":"https://api.github.com/repos/mozilla-services/cornice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/cornice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/cornice/teams","hooks_url":"https://api.github.com/repos/mozilla-services/cornice/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/cornice/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/cornice/events","assignees_url":"https://api.github.com/repos/mozilla-services/cornice/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/cornice/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/cornice/tags","blobs_url":"https://api.github.com/repos/mozilla-services/cornice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/cornice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/cornice/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/cornice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/cornice/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/cornice/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/cornice/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/cornice/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/cornice/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/cornice/subscription","commits_url":"https://api.github.com/repos/mozilla-services/cornice/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/cornice/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/cornice/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/cornice/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-services/cornice/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/cornice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/cornice/merges","archive_url":"https://api.github.com/repos/mozilla-services/cornice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/cornice/downloads","issues_url":"https://api.github.com/repos/mozilla-services/cornice/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/cornice/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/cornice/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/cornice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/cornice/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/cornice/releases{/id}","created_at":"2011-10-12T13:17:51Z","updated_at":"2015-01-28T16:37:58Z","pushed_at":"2015-01-28T16:37:58Z","git_url":"git://github.com/mozilla-services/cornice.git","ssh_url":"git@github.com:mozilla-services/cornice.git","clone_url":"https://github.com/mozilla-services/cornice.git","svn_url":"https://github.com/mozilla-services/cornice","homepage":"http://cornice.rtfd.org","size":1982,"stargazers_count":201,"watchers_count":201,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":45,"forks":97,"open_issues":45,"watchers":201,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/cornice/pulls/256"},"html":{"href":"https://github.com/mozilla-services/cornice/pull/256"},"issue":{"href":"https://api.github.com/repos/mozilla-services/cornice/issues/256"},"comments":{"href":"https://api.github.com/repos/mozilla-services/cornice/issues/256/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/cornice/pulls/256/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/cornice/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/cornice/pulls/256/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/cornice/statuses/5732a0a88cdc71abd760ed8872c0bc5a67383ab6"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"ametaireau","id":67073,"avatar_url":"https://avatars.githubusercontent.com/u/67073?v=3","gravatar_id":"","url":"https://api.github.com/users/ametaireau","html_url":"https://github.com/ametaireau","followers_url":"https://api.github.com/users/ametaireau/followers","following_url":"https://api.github.com/users/ametaireau/following{/other_user}","gists_url":"https://api.github.com/users/ametaireau/gists{/gist_id}","starred_url":"https://api.github.com/users/ametaireau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ametaireau/subscriptions","organizations_url":"https://api.github.com/users/ametaireau/orgs","repos_url":"https://api.github.com/users/ametaireau/repos","events_url":"https://api.github.com/users/ametaireau/events{/privacy}","received_events_url":"https://api.github.com/users/ametaireau/received_events","type":"User","site_admin":false},"comments":10,"review_comments":0,"commits":1,"additions":2,"deletions":49,"changed_files":3}}