{"action":"created","comment":{"url":"https://api.github.com/repos/zooniverse/Panoptes/pulls/comments/22942747","id":22942747,"diff_hunk":"@@ -0,0 +1,28 @@\n+module JsonApiController\n+  module PreconditionCheck\n+    def precondition_check\n+      if !precondition\n+        raise PreconditionNotPresent, precondition_error_msg\n+      elsif precondition_fails?\n+        raise PreconditionFailed\n+      end\n+    end\n+    \n+    def precondition\n+      case action_name\n+      when \"show\"\n+        request.headers[\"If-Modified-Since\"]\n+      else\n+        request.headers[\"If-Unmodified-Since\"]","path":"lib/json_api_controller/precondition_check.rb","position":16,"original_position":16,"commit_id":"0d59ab7b48477c5f9eead61122731ff8d3b14fab","original_commit_id":"2be830df69bf7a1b5d902eba4b119ed6bbe777f1","user":{"login":"edpaget","id":108177,"avatar_url":"https://avatars.githubusercontent.com/u/108177?v=3","gravatar_id":"","url":"https://api.github.com/users/edpaget","html_url":"https://github.com/edpaget","followers_url":"https://api.github.com/users/edpaget/followers","following_url":"https://api.github.com/users/edpaget/following{/other_user}","gists_url":"https://api.github.com/users/edpaget/gists{/gist_id}","starred_url":"https://api.github.com/users/edpaget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edpaget/subscriptions","organizations_url":"https://api.github.com/users/edpaget/orgs","repos_url":"https://api.github.com/users/edpaget/repos","events_url":"https://api.github.com/users/edpaget/events{/privacy}","received_events_url":"https://api.github.com/users/edpaget/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2015-01-14T15:20:55Z","updated_at":"2015-01-14T15:20:55Z","html_url":"https://github.com/zooniverse/Panoptes/pull/430#discussion_r22942747","pull_request_url":"https://api.github.com/repos/zooniverse/Panoptes/pulls/430","_links":{"self":{"href":"https://api.github.com/repos/zooniverse/Panoptes/pulls/comments/22942747"},"html":{"href":"https://github.com/zooniverse/Panoptes/pull/430#discussion_r22942747"},"pull_request":{"href":"https://api.github.com/repos/zooniverse/Panoptes/pulls/430"}}},"pull_request":{"url":"https://api.github.com/repos/zooniverse/Panoptes/pulls/430","id":27124017,"html_url":"https://github.com/zooniverse/Panoptes/pull/430","diff_url":"https://github.com/zooniverse/Panoptes/pull/430.diff","patch_url":"https://github.com/zooniverse/Panoptes/pull/430.patch","issue_url":"https://api.github.com/repos/zooniverse/Panoptes/issues/430","number":430,"state":"open","locked":false,"title":"Add support for Conditional Requests","user":{"login":"edpaget","id":108177,"avatar_url":"https://avatars.githubusercontent.com/u/108177?v=3","gravatar_id":"","url":"https://api.github.com/users/edpaget","html_url":"https://github.com/edpaget","followers_url":"https://api.github.com/users/edpaget/followers","following_url":"https://api.github.com/users/edpaget/following{/other_user}","gists_url":"https://api.github.com/users/edpaget/gists{/gist_id}","starred_url":"https://api.github.com/users/edpaget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edpaget/subscriptions","organizations_url":"https://api.github.com/users/edpaget/orgs","repos_url":"https://api.github.com/users/edpaget/repos","events_url":"https://api.github.com/users/edpaget/events{/privacy}","received_events_url":"https://api.github.com/users/edpaget/received_events","type":"User","site_admin":false},"body":"Using Last-Modified. Closes #296","created_at":"2015-01-09T19:45:47Z","updated_at":"2015-01-14T15:20:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fffbf25611eb8ec5ae70572a105687ab48cbb34","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zooniverse/Panoptes/pulls/430/commits","review_comments_url":"https://api.github.com/repos/zooniverse/Panoptes/pulls/430/comments","review_comment_url":"https://api.github.com/repos/zooniverse/Panoptes/pulls/comments/{number}","comments_url":"https://api.github.com/repos/zooniverse/Panoptes/issues/430/comments","statuses_url":"https://api.github.com/repos/zooniverse/Panoptes/statuses/0d59ab7b48477c5f9eead61122731ff8d3b14fab","head":{"label":"edpaget:locking","ref":"locking","sha":"0d59ab7b48477c5f9eead61122731ff8d3b14fab","user":{"login":"edpaget","id":108177,"avatar_url":"https://avatars.githubusercontent.com/u/108177?v=3","gravatar_id":"","url":"https://api.github.com/users/edpaget","html_url":"https://github.com/edpaget","followers_url":"https://api.github.com/users/edpaget/followers","following_url":"https://api.github.com/users/edpaget/following{/other_user}","gists_url":"https://api.github.com/users/edpaget/gists{/gist_id}","starred_url":"https://api.github.com/users/edpaget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edpaget/subscriptions","organizations_url":"https://api.github.com/users/edpaget/orgs","repos_url":"https://api.github.com/users/edpaget/repos","events_url":"https://api.github.com/users/edpaget/events{/privacy}","received_events_url":"https://api.github.com/users/edpaget/received_events","type":"User","site_admin":false},"repo":{"id":20313194,"name":"Panoptes","full_name":"edpaget/Panoptes","owner":{"login":"edpaget","id":108177,"avatar_url":"https://avatars.githubusercontent.com/u/108177?v=3","gravatar_id":"","url":"https://api.github.com/users/edpaget","html_url":"https://github.com/edpaget","followers_url":"https://api.github.com/users/edpaget/followers","following_url":"https://api.github.com/users/edpaget/following{/other_user}","gists_url":"https://api.github.com/users/edpaget/gists{/gist_id}","starred_url":"https://api.github.com/users/edpaget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edpaget/subscriptions","organizations_url":"https://api.github.com/users/edpaget/orgs","repos_url":"https://api.github.com/users/edpaget/repos","events_url":"https://api.github.com/users/edpaget/events{/privacy}","received_events_url":"https://api.github.com/users/edpaget/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edpaget/Panoptes","description":"It sees everything","fork":true,"url":"https://api.github.com/repos/edpaget/Panoptes","forks_url":"https://api.github.com/repos/edpaget/Panoptes/forks","keys_url":"https://api.github.com/repos/edpaget/Panoptes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edpaget/Panoptes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edpaget/Panoptes/teams","hooks_url":"https://api.github.com/repos/edpaget/Panoptes/hooks","issue_events_url":"https://api.github.com/repos/edpaget/Panoptes/issues/events{/number}","events_url":"https://api.github.com/repos/edpaget/Panoptes/events","assignees_url":"https://api.github.com/repos/edpaget/Panoptes/assignees{/user}","branches_url":"https://api.github.com/repos/edpaget/Panoptes/branches{/branch}","tags_url":"https://api.github.com/repos/edpaget/Panoptes/tags","blobs_url":"https://api.github.com/repos/edpaget/Panoptes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edpaget/Panoptes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edpaget/Panoptes/git/refs{/sha}","trees_url":"https://api.github.com/repos/edpaget/Panoptes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edpaget/Panoptes/statuses/{sha}","languages_url":"https://api.github.com/repos/edpaget/Panoptes/languages","stargazers_url":"https://api.github.com/repos/edpaget/Panoptes/stargazers","contributors_url":"https://api.github.com/repos/edpaget/Panoptes/contributors","subscribers_url":"https://api.github.com/repos/edpaget/Panoptes/subscribers","subscription_url":"https://api.github.com/repos/edpaget/Panoptes/subscription","commits_url":"https://api.github.com/repos/edpaget/Panoptes/commits{/sha}","git_commits_url":"https://api.github.com/repos/edpaget/Panoptes/git/commits{/sha}","comments_url":"https://api.github.com/repos/edpaget/Panoptes/comments{/number}","issue_comment_url":"https://api.github.com/repos/edpaget/Panoptes/issues/comments/{number}","contents_url":"https://api.github.com/repos/edpaget/Panoptes/contents/{+path}","compare_url":"https://api.github.com/repos/edpaget/Panoptes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edpaget/Panoptes/merges","archive_url":"https://api.github.com/repos/edpaget/Panoptes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edpaget/Panoptes/downloads","issues_url":"https://api.github.com/repos/edpaget/Panoptes/issues{/number}","pulls_url":"https://api.github.com/repos/edpaget/Panoptes/pulls{/number}","milestones_url":"https://api.github.com/repos/edpaget/Panoptes/milestones{/number}","notifications_url":"https://api.github.com/repos/edpaget/Panoptes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edpaget/Panoptes/labels{/name}","releases_url":"https://api.github.com/repos/edpaget/Panoptes/releases{/id}","created_at":"2014-05-30T01:09:54Z","updated_at":"2014-12-12T22:07:18Z","pushed_at":"2015-01-12T19:51:24Z","git_url":"git://github.com/edpaget/Panoptes.git","ssh_url":"git@github.com:edpaget/Panoptes.git","clone_url":"https://github.com/edpaget/Panoptes.git","svn_url":"https://github.com/edpaget/Panoptes","homepage":"","size":4265,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"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":"zooniverse:master","ref":"master","sha":"3e77df14aa565f17c7ac7b29435855e3577285cd","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"repo":{"id":19036577,"name":"Panoptes","full_name":"zooniverse/Panoptes","owner":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zooniverse/Panoptes","description":"It sees everything","fork":false,"url":"https://api.github.com/repos/zooniverse/Panoptes","forks_url":"https://api.github.com/repos/zooniverse/Panoptes/forks","keys_url":"https://api.github.com/repos/zooniverse/Panoptes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooniverse/Panoptes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooniverse/Panoptes/teams","hooks_url":"https://api.github.com/repos/zooniverse/Panoptes/hooks","issue_events_url":"https://api.github.com/repos/zooniverse/Panoptes/issues/events{/number}","events_url":"https://api.github.com/repos/zooniverse/Panoptes/events","assignees_url":"https://api.github.com/repos/zooniverse/Panoptes/assignees{/user}","branches_url":"https://api.github.com/repos/zooniverse/Panoptes/branches{/branch}","tags_url":"https://api.github.com/repos/zooniverse/Panoptes/tags","blobs_url":"https://api.github.com/repos/zooniverse/Panoptes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooniverse/Panoptes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooniverse/Panoptes/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooniverse/Panoptes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooniverse/Panoptes/statuses/{sha}","languages_url":"https://api.github.com/repos/zooniverse/Panoptes/languages","stargazers_url":"https://api.github.com/repos/zooniverse/Panoptes/stargazers","contributors_url":"https://api.github.com/repos/zooniverse/Panoptes/contributors","subscribers_url":"https://api.github.com/repos/zooniverse/Panoptes/subscribers","subscription_url":"https://api.github.com/repos/zooniverse/Panoptes/subscription","commits_url":"https://api.github.com/repos/zooniverse/Panoptes/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooniverse/Panoptes/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooniverse/Panoptes/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooniverse/Panoptes/issues/comments/{number}","contents_url":"https://api.github.com/repos/zooniverse/Panoptes/contents/{+path}","compare_url":"https://api.github.com/repos/zooniverse/Panoptes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooniverse/Panoptes/merges","archive_url":"https://api.github.com/repos/zooniverse/Panoptes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooniverse/Panoptes/downloads","issues_url":"https://api.github.com/repos/zooniverse/Panoptes/issues{/number}","pulls_url":"https://api.github.com/repos/zooniverse/Panoptes/pulls{/number}","milestones_url":"https://api.github.com/repos/zooniverse/Panoptes/milestones{/number}","notifications_url":"https://api.github.com/repos/zooniverse/Panoptes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooniverse/Panoptes/labels{/name}","releases_url":"https://api.github.com/repos/zooniverse/Panoptes/releases{/id}","created_at":"2014-04-22T16:16:02Z","updated_at":"2015-01-14T09:34:08Z","pushed_at":"2015-01-07T02:20:26Z","git_url":"git://github.com/zooniverse/Panoptes.git","ssh_url":"git@github.com:zooniverse/Panoptes.git","clone_url":"https://github.com/zooniverse/Panoptes.git","svn_url":"https://github.com/zooniverse/Panoptes","homepage":"","size":4870,"stargazers_count":8,"watchers_count":8,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":33,"forks":8,"open_issues":33,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zooniverse/Panoptes/pulls/430"},"html":{"href":"https://github.com/zooniverse/Panoptes/pull/430"},"issue":{"href":"https://api.github.com/repos/zooniverse/Panoptes/issues/430"},"comments":{"href":"https://api.github.com/repos/zooniverse/Panoptes/issues/430/comments"},"review_comments":{"href":"https://api.github.com/repos/zooniverse/Panoptes/pulls/430/comments"},"review_comment":{"href":"https://api.github.com/repos/zooniverse/Panoptes/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/zooniverse/Panoptes/pulls/430/commits"},"statuses":{"href":"https://api.github.com/repos/zooniverse/Panoptes/statuses/0d59ab7b48477c5f9eead61122731ff8d3b14fab"}}}}