{"action":"created","comment":{"url":"https://api.github.com/repos/box/ClusterRunner/pulls/comments/37478858","id":37478858,"diff_hunk":"@@ -64,9 +66,31 @@ def initialize(self, route_node=None, cluster_master=None):\n         :type route_node: RouteNode | None\n         :type cluster_master: ClusterMaster | None\n         \"\"\"\n+        self._logger = log.get_logger(__name__)\n         self._cluster_master = cluster_master\n         super().initialize(route_node)\n \n+    def prepare(self):\n+        \"\"\"\n+        If the request has specified the session id, which is optional, and the session id does not match\n+        the current instance's session id, then the client is asking for a resource that has expired and\n+        no longer exists.\n+        \"\"\"\n+        session_id = self.request.headers.get(SessionId.SESSION_HEADER_KEY)\n+\n+        if session_id is not None and session_id != SessionId.get():\n+            raise ItemNotFoundError('Specified session id: {} has expired and is invalid.'.format(session_id))\n+\n+        super().prepare()\n+\n+    def write(self, response):","path":"app/web_framework/cluster_master_application.py","position":33,"original_position":33,"commit_id":"0fcc476796d9fe0d9f878f8fec22ab36fef0bc51","original_commit_id":"0fcc476796d9fe0d9f878f8fec22ab36fef0bc51","user":{"login":"tjlee0909","id":3615089,"avatar_url":"https://avatars.githubusercontent.com/u/3615089?v=3","gravatar_id":"","url":"https://api.github.com/users/tjlee0909","html_url":"https://github.com/tjlee0909","followers_url":"https://api.github.com/users/tjlee0909/followers","following_url":"https://api.github.com/users/tjlee0909/following{/other_user}","gists_url":"https://api.github.com/users/tjlee0909/gists{/gist_id}","starred_url":"https://api.github.com/users/tjlee0909/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjlee0909/subscriptions","organizations_url":"https://api.github.com/users/tjlee0909/orgs","repos_url":"https://api.github.com/users/tjlee0909/repos","events_url":"https://api.github.com/users/tjlee0909/events{/privacy}","received_events_url":"https://api.github.com/users/tjlee0909/received_events","type":"User","site_admin":false},"body":"Unless you meant adding it to set_default_headers() in this class, not the ClusterBaseAPIHandler()","created_at":"2015-08-19T22:56:21Z","updated_at":"2015-08-19T22:56:21Z","html_url":"https://github.com/box/ClusterRunner/pull/249#discussion_r37478858","pull_request_url":"https://api.github.com/repos/box/ClusterRunner/pulls/249","_links":{"self":{"href":"https://api.github.com/repos/box/ClusterRunner/pulls/comments/37478858"},"html":{"href":"https://github.com/box/ClusterRunner/pull/249#discussion_r37478858"},"pull_request":{"href":"https://api.github.com/repos/box/ClusterRunner/pulls/249"}}},"pull_request":{"url":"https://api.github.com/repos/box/ClusterRunner/pulls/249","id":42872626,"html_url":"https://github.com/box/ClusterRunner/pull/249","diff_url":"https://github.com/box/ClusterRunner/pull/249.diff","patch_url":"https://github.com/box/ClusterRunner/pull/249.patch","issue_url":"https://api.github.com/repos/box/ClusterRunner/issues/249","number":249,"state":"open","locked":false,"title":"Generate session id in cluster master, and return in every response.","user":{"login":"tjlee0909","id":3615089,"avatar_url":"https://avatars.githubusercontent.com/u/3615089?v=3","gravatar_id":"","url":"https://api.github.com/users/tjlee0909","html_url":"https://github.com/tjlee0909","followers_url":"https://api.github.com/users/tjlee0909/followers","following_url":"https://api.github.com/users/tjlee0909/following{/other_user}","gists_url":"https://api.github.com/users/tjlee0909/gists{/gist_id}","starred_url":"https://api.github.com/users/tjlee0909/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjlee0909/subscriptions","organizations_url":"https://api.github.com/users/tjlee0909/orgs","repos_url":"https://api.github.com/users/tjlee0909/repos","events_url":"https://api.github.com/users/tjlee0909/events{/privacy}","received_events_url":"https://api.github.com/users/tjlee0909/received_events","type":"User","site_admin":false},"body":"Additionally, if the session id is specified in the header then enforce that it matches the current session id. If not, return a 404.","created_at":"2015-08-19T22:35:56Z","updated_at":"2015-08-19T22:56:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec0572e621d9d1bde2d47b91e502764d1f85c290","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/box/ClusterRunner/pulls/249/commits","review_comments_url":"https://api.github.com/repos/box/ClusterRunner/pulls/249/comments","review_comment_url":"https://api.github.com/repos/box/ClusterRunner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/box/ClusterRunner/issues/249/comments","statuses_url":"https://api.github.com/repos/box/ClusterRunner/statuses/0fcc476796d9fe0d9f878f8fec22ab36fef0bc51","head":{"label":"box:generate_session_ids_on_master","ref":"generate_session_ids_on_master","sha":"0fcc476796d9fe0d9f878f8fec22ab36fef0bc51","user":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"repo":{"id":25371175,"name":"ClusterRunner","full_name":"box/ClusterRunner","owner":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/box/ClusterRunner","description":"ClusterRunner makes it easy to execute test-suites across your infrastructure in the fastest and most efficient way possible.","fork":false,"url":"https://api.github.com/repos/box/ClusterRunner","forks_url":"https://api.github.com/repos/box/ClusterRunner/forks","keys_url":"https://api.github.com/repos/box/ClusterRunner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/box/ClusterRunner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/box/ClusterRunner/teams","hooks_url":"https://api.github.com/repos/box/ClusterRunner/hooks","issue_events_url":"https://api.github.com/repos/box/ClusterRunner/issues/events{/number}","events_url":"https://api.github.com/repos/box/ClusterRunner/events","assignees_url":"https://api.github.com/repos/box/ClusterRunner/assignees{/user}","branches_url":"https://api.github.com/repos/box/ClusterRunner/branches{/branch}","tags_url":"https://api.github.com/repos/box/ClusterRunner/tags","blobs_url":"https://api.github.com/repos/box/ClusterRunner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/box/ClusterRunner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/box/ClusterRunner/git/refs{/sha}","trees_url":"https://api.github.com/repos/box/ClusterRunner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/box/ClusterRunner/statuses/{sha}","languages_url":"https://api.github.com/repos/box/ClusterRunner/languages","stargazers_url":"https://api.github.com/repos/box/ClusterRunner/stargazers","contributors_url":"https://api.github.com/repos/box/ClusterRunner/contributors","subscribers_url":"https://api.github.com/repos/box/ClusterRunner/subscribers","subscription_url":"https://api.github.com/repos/box/ClusterRunner/subscription","commits_url":"https://api.github.com/repos/box/ClusterRunner/commits{/sha}","git_commits_url":"https://api.github.com/repos/box/ClusterRunner/git/commits{/sha}","comments_url":"https://api.github.com/repos/box/ClusterRunner/comments{/number}","issue_comment_url":"https://api.github.com/repos/box/ClusterRunner/issues/comments{/number}","contents_url":"https://api.github.com/repos/box/ClusterRunner/contents/{+path}","compare_url":"https://api.github.com/repos/box/ClusterRunner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/box/ClusterRunner/merges","archive_url":"https://api.github.com/repos/box/ClusterRunner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/box/ClusterRunner/downloads","issues_url":"https://api.github.com/repos/box/ClusterRunner/issues{/number}","pulls_url":"https://api.github.com/repos/box/ClusterRunner/pulls{/number}","milestones_url":"https://api.github.com/repos/box/ClusterRunner/milestones{/number}","notifications_url":"https://api.github.com/repos/box/ClusterRunner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/box/ClusterRunner/labels{/name}","releases_url":"https://api.github.com/repos/box/ClusterRunner/releases{/id}","created_at":"2014-10-17T18:20:39Z","updated_at":"2015-07-07T15:58:06Z","pushed_at":"2015-08-19T22:37:28Z","git_url":"git://github.com/box/ClusterRunner.git","ssh_url":"git@github.com:box/ClusterRunner.git","clone_url":"https://github.com/box/ClusterRunner.git","svn_url":"https://github.com/box/ClusterRunner","homepage":"http://clusterrunner.com","size":6977,"stargazers_count":56,"watchers_count":56,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":40,"forks":13,"open_issues":40,"watchers":56,"default_branch":"master"}},"base":{"label":"box:master","ref":"master","sha":"26c64b5e6baa058663bc9bdda924452a683d609b","user":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"repo":{"id":25371175,"name":"ClusterRunner","full_name":"box/ClusterRunner","owner":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/box/ClusterRunner","description":"ClusterRunner makes it easy to execute test-suites across your infrastructure in the fastest and most efficient way possible.","fork":false,"url":"https://api.github.com/repos/box/ClusterRunner","forks_url":"https://api.github.com/repos/box/ClusterRunner/forks","keys_url":"https://api.github.com/repos/box/ClusterRunner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/box/ClusterRunner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/box/ClusterRunner/teams","hooks_url":"https://api.github.com/repos/box/ClusterRunner/hooks","issue_events_url":"https://api.github.com/repos/box/ClusterRunner/issues/events{/number}","events_url":"https://api.github.com/repos/box/ClusterRunner/events","assignees_url":"https://api.github.com/repos/box/ClusterRunner/assignees{/user}","branches_url":"https://api.github.com/repos/box/ClusterRunner/branches{/branch}","tags_url":"https://api.github.com/repos/box/ClusterRunner/tags","blobs_url":"https://api.github.com/repos/box/ClusterRunner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/box/ClusterRunner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/box/ClusterRunner/git/refs{/sha}","trees_url":"https://api.github.com/repos/box/ClusterRunner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/box/ClusterRunner/statuses/{sha}","languages_url":"https://api.github.com/repos/box/ClusterRunner/languages","stargazers_url":"https://api.github.com/repos/box/ClusterRunner/stargazers","contributors_url":"https://api.github.com/repos/box/ClusterRunner/contributors","subscribers_url":"https://api.github.com/repos/box/ClusterRunner/subscribers","subscription_url":"https://api.github.com/repos/box/ClusterRunner/subscription","commits_url":"https://api.github.com/repos/box/ClusterRunner/commits{/sha}","git_commits_url":"https://api.github.com/repos/box/ClusterRunner/git/commits{/sha}","comments_url":"https://api.github.com/repos/box/ClusterRunner/comments{/number}","issue_comment_url":"https://api.github.com/repos/box/ClusterRunner/issues/comments{/number}","contents_url":"https://api.github.com/repos/box/ClusterRunner/contents/{+path}","compare_url":"https://api.github.com/repos/box/ClusterRunner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/box/ClusterRunner/merges","archive_url":"https://api.github.com/repos/box/ClusterRunner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/box/ClusterRunner/downloads","issues_url":"https://api.github.com/repos/box/ClusterRunner/issues{/number}","pulls_url":"https://api.github.com/repos/box/ClusterRunner/pulls{/number}","milestones_url":"https://api.github.com/repos/box/ClusterRunner/milestones{/number}","notifications_url":"https://api.github.com/repos/box/ClusterRunner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/box/ClusterRunner/labels{/name}","releases_url":"https://api.github.com/repos/box/ClusterRunner/releases{/id}","created_at":"2014-10-17T18:20:39Z","updated_at":"2015-07-07T15:58:06Z","pushed_at":"2015-08-19T22:37:28Z","git_url":"git://github.com/box/ClusterRunner.git","ssh_url":"git@github.com:box/ClusterRunner.git","clone_url":"https://github.com/box/ClusterRunner.git","svn_url":"https://github.com/box/ClusterRunner","homepage":"http://clusterrunner.com","size":6977,"stargazers_count":56,"watchers_count":56,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":40,"forks":13,"open_issues":40,"watchers":56,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/box/ClusterRunner/pulls/249"},"html":{"href":"https://github.com/box/ClusterRunner/pull/249"},"issue":{"href":"https://api.github.com/repos/box/ClusterRunner/issues/249"},"comments":{"href":"https://api.github.com/repos/box/ClusterRunner/issues/249/comments"},"review_comments":{"href":"https://api.github.com/repos/box/ClusterRunner/pulls/249/comments"},"review_comment":{"href":"https://api.github.com/repos/box/ClusterRunner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/box/ClusterRunner/pulls/249/commits"},"statuses":{"href":"https://api.github.com/repos/box/ClusterRunner/statuses/0fcc476796d9fe0d9f878f8fec22ab36fef0bc51"}}}}