{"action":"created","comment":{"url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments/143318885","pull_request_review_id":67821302,"id":143318885,"diff_hunk":"@@ -178,7 +178,14 @@ public StatisticsController(IStatisticsService statisticsService, IAggregateStat\n                 return new HttpStatusCodeResult(HttpStatusCode.NotFound);\n             }\n \n-            return Json(await GetPackageDownloadsByVersionReport(id, groupby), JsonRequestBehavior.AllowGet);\n+            var packageStatisticsReport = await GetPackageDownloadsByVersionReport(id, groupby);\n+\n+            if (packageStatisticsReport == null)\n+            {\n+                return new HttpStatusCodeResult(HttpStatusCode.NotFound);\n+            }\n+\n+            return Json(packageStatisticsReport, JsonRequestBehavior.AllowGet);","path":"src/NuGetGallery/Controllers/StatisticsController.cs","position":12,"original_position":12,"commit_id":"3204b89495aa3f3980464040b3b463bdeb6ba7cc","original_commit_id":"3204b89495aa3f3980464040b3b463bdeb6ba7cc","user":{"login":"joelverhagen","id":94054,"avatar_url":"https://avatars0.githubusercontent.com/u/94054?v=4","gravatar_id":"","url":"https://api.github.com/users/joelverhagen","html_url":"https://github.com/joelverhagen","followers_url":"https://api.github.com/users/joelverhagen/followers","following_url":"https://api.github.com/users/joelverhagen/following{/other_user}","gists_url":"https://api.github.com/users/joelverhagen/gists{/gist_id}","starred_url":"https://api.github.com/users/joelverhagen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelverhagen/subscriptions","organizations_url":"https://api.github.com/users/joelverhagen/orgs","repos_url":"https://api.github.com/users/joelverhagen/repos","events_url":"https://api.github.com/users/joelverhagen/events{/privacy}","received_events_url":"https://api.github.com/users/joelverhagen/received_events","type":"User","site_admin":false},"body":"There is an overload `Json(int httpStatusCode, object data, JsonRequestBehavior behavior)` which allows you to both return `Content-Type: application/json` and set the status code to 200 or 404. Could you use that instead?\r\n\r\nAt that point you can change the method to return `Task<JsonResult>` instead of the more generic `Task<ActionResult>`.","created_at":"2017-10-07T01:23:23Z","updated_at":"2017-10-07T01:23:23Z","html_url":"https://github.com/NuGet/NuGetGallery/pull/4798#discussion_r143318885","pull_request_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4798","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments/143318885"},"html":{"href":"https://github.com/NuGet/NuGetGallery/pull/4798#discussion_r143318885"},"pull_request":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4798"}}},"pull_request":{"url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4798","id":144549882,"html_url":"https://github.com/NuGet/NuGetGallery/pull/4798","diff_url":"https://github.com/NuGet/NuGetGallery/pull/4798.diff","patch_url":"https://github.com/NuGet/NuGetGallery/pull/4798.patch","issue_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/4798","number":4798,"state":"open","locked":false,"title":"4701: Return 404, not 200, when package doesn't exist.","user":{"login":"rafcioki","id":24827858,"avatar_url":"https://avatars3.githubusercontent.com/u/24827858?v=4","gravatar_id":"","url":"https://api.github.com/users/rafcioki","html_url":"https://github.com/rafcioki","followers_url":"https://api.github.com/users/rafcioki/followers","following_url":"https://api.github.com/users/rafcioki/following{/other_user}","gists_url":"https://api.github.com/users/rafcioki/gists{/gist_id}","starred_url":"https://api.github.com/users/rafcioki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafcioki/subscriptions","organizations_url":"https://api.github.com/users/rafcioki/orgs","repos_url":"https://api.github.com/users/rafcioki/repos","events_url":"https://api.github.com/users/rafcioki/events{/privacy}","received_events_url":"https://api.github.com/users/rafcioki/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-03T23:08:00Z","updated_at":"2017-10-07T01:23:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f47659bc43efd350d7d984920585bd1b460d3d2","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4798/commits","review_comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4798/comments","review_comment_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/4798/comments","statuses_url":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/3204b89495aa3f3980464040b3b463bdeb6ba7cc","head":{"label":"rafcioki:rafcioki-4701","ref":"rafcioki-4701","sha":"3204b89495aa3f3980464040b3b463bdeb6ba7cc","user":{"login":"rafcioki","id":24827858,"avatar_url":"https://avatars3.githubusercontent.com/u/24827858?v=4","gravatar_id":"","url":"https://api.github.com/users/rafcioki","html_url":"https://github.com/rafcioki","followers_url":"https://api.github.com/users/rafcioki/followers","following_url":"https://api.github.com/users/rafcioki/following{/other_user}","gists_url":"https://api.github.com/users/rafcioki/gists{/gist_id}","starred_url":"https://api.github.com/users/rafcioki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafcioki/subscriptions","organizations_url":"https://api.github.com/users/rafcioki/orgs","repos_url":"https://api.github.com/users/rafcioki/repos","events_url":"https://api.github.com/users/rafcioki/events{/privacy}","received_events_url":"https://api.github.com/users/rafcioki/received_events","type":"User","site_admin":false},"repo":{"id":105590155,"name":"NuGetGallery","full_name":"rafcioki/NuGetGallery","owner":{"login":"rafcioki","id":24827858,"avatar_url":"https://avatars3.githubusercontent.com/u/24827858?v=4","gravatar_id":"","url":"https://api.github.com/users/rafcioki","html_url":"https://github.com/rafcioki","followers_url":"https://api.github.com/users/rafcioki/followers","following_url":"https://api.github.com/users/rafcioki/following{/other_user}","gists_url":"https://api.github.com/users/rafcioki/gists{/gist_id}","starred_url":"https://api.github.com/users/rafcioki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafcioki/subscriptions","organizations_url":"https://api.github.com/users/rafcioki/orgs","repos_url":"https://api.github.com/users/rafcioki/repos","events_url":"https://api.github.com/users/rafcioki/events{/privacy}","received_events_url":"https://api.github.com/users/rafcioki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rafcioki/NuGetGallery","description":"The NuGet Gallery","fork":true,"url":"https://api.github.com/repos/rafcioki/NuGetGallery","forks_url":"https://api.github.com/repos/rafcioki/NuGetGallery/forks","keys_url":"https://api.github.com/repos/rafcioki/NuGetGallery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rafcioki/NuGetGallery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rafcioki/NuGetGallery/teams","hooks_url":"https://api.github.com/repos/rafcioki/NuGetGallery/hooks","issue_events_url":"https://api.github.com/repos/rafcioki/NuGetGallery/issues/events{/number}","events_url":"https://api.github.com/repos/rafcioki/NuGetGallery/events","assignees_url":"https://api.github.com/repos/rafcioki/NuGetGallery/assignees{/user}","branches_url":"https://api.github.com/repos/rafcioki/NuGetGallery/branches{/branch}","tags_url":"https://api.github.com/repos/rafcioki/NuGetGallery/tags","blobs_url":"https://api.github.com/repos/rafcioki/NuGetGallery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rafcioki/NuGetGallery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rafcioki/NuGetGallery/git/refs{/sha}","trees_url":"https://api.github.com/repos/rafcioki/NuGetGallery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rafcioki/NuGetGallery/statuses/{sha}","languages_url":"https://api.github.com/repos/rafcioki/NuGetGallery/languages","stargazers_url":"https://api.github.com/repos/rafcioki/NuGetGallery/stargazers","contributors_url":"https://api.github.com/repos/rafcioki/NuGetGallery/contributors","subscribers_url":"https://api.github.com/repos/rafcioki/NuGetGallery/subscribers","subscription_url":"https://api.github.com/repos/rafcioki/NuGetGallery/subscription","commits_url":"https://api.github.com/repos/rafcioki/NuGetGallery/commits{/sha}","git_commits_url":"https://api.github.com/repos/rafcioki/NuGetGallery/git/commits{/sha}","comments_url":"https://api.github.com/repos/rafcioki/NuGetGallery/comments{/number}","issue_comment_url":"https://api.github.com/repos/rafcioki/NuGetGallery/issues/comments{/number}","contents_url":"https://api.github.com/repos/rafcioki/NuGetGallery/contents/{+path}","compare_url":"https://api.github.com/repos/rafcioki/NuGetGallery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rafcioki/NuGetGallery/merges","archive_url":"https://api.github.com/repos/rafcioki/NuGetGallery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rafcioki/NuGetGallery/downloads","issues_url":"https://api.github.com/repos/rafcioki/NuGetGallery/issues{/number}","pulls_url":"https://api.github.com/repos/rafcioki/NuGetGallery/pulls{/number}","milestones_url":"https://api.github.com/repos/rafcioki/NuGetGallery/milestones{/number}","notifications_url":"https://api.github.com/repos/rafcioki/NuGetGallery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rafcioki/NuGetGallery/labels{/name}","releases_url":"https://api.github.com/repos/rafcioki/NuGetGallery/releases{/id}","deployments_url":"https://api.github.com/repos/rafcioki/NuGetGallery/deployments","created_at":"2017-10-02T22:07:22Z","updated_at":"2017-10-02T22:07:28Z","pushed_at":"2017-10-03T23:05:40Z","git_url":"git://github.com/rafcioki/NuGetGallery.git","ssh_url":"git@github.com:rafcioki/NuGetGallery.git","clone_url":"https://github.com/rafcioki/NuGetGallery.git","svn_url":"https://github.com/rafcioki/NuGetGallery","homepage":"http://www.nuget.org","size":43848,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NuGet:dev","ref":"dev","sha":"1b086f30b796a5eda8d873161672d75c9abb1c7e","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars2.githubusercontent.com/u/968310?v=4","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":2180736,"name":"NuGetGallery","full_name":"NuGet/NuGetGallery","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars2.githubusercontent.com/u/968310?v=4","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGetGallery","description":"The NuGet Gallery","fork":false,"url":"https://api.github.com/repos/NuGet/NuGetGallery","forks_url":"https://api.github.com/repos/NuGet/NuGetGallery/forks","keys_url":"https://api.github.com/repos/NuGet/NuGetGallery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGetGallery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGetGallery/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGetGallery/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGetGallery/events","assignees_url":"https://api.github.com/repos/NuGet/NuGetGallery/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGetGallery/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGetGallery/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGetGallery/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGetGallery/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGetGallery/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGetGallery/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGetGallery/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGetGallery/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGetGallery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGetGallery/merges","archive_url":"https://api.github.com/repos/NuGet/NuGetGallery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGetGallery/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGetGallery/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGetGallery/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGetGallery/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGetGallery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGetGallery/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGetGallery/releases{/id}","deployments_url":"https://api.github.com/repos/NuGet/NuGetGallery/deployments","created_at":"2011-08-09T17:57:32Z","updated_at":"2017-10-06T02:46:16Z","pushed_at":"2017-10-06T22:46:32Z","git_url":"git://github.com/NuGet/NuGetGallery.git","ssh_url":"git@github.com:NuGet/NuGetGallery.git","clone_url":"https://github.com/NuGet/NuGetGallery.git","svn_url":"https://github.com/NuGet/NuGetGallery","homepage":"http://www.nuget.org","size":43971,"stargazers_count":927,"watchers_count":927,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":521,"mirror_url":null,"open_issues_count":407,"forks":521,"open_issues":407,"watchers":927,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4798"},"html":{"href":"https://github.com/NuGet/NuGetGallery/pull/4798"},"issue":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/issues/4798"},"comments":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/issues/4798/comments"},"review_comments":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4798/comments"},"review_comment":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/pulls/4798/commits"},"statuses":{"href":"https://api.github.com/repos/NuGet/NuGetGallery/statuses/3204b89495aa3f3980464040b3b463bdeb6ba7cc"}},"author_association":"NONE"}}
{"actor":{"display_login":"joelverhagen"}}