{"action":"created","comment":{"url":"https://api.github.com/repos/paritytech/jsonrpc/pulls/comments/212661675","pull_request_review_id":149345112,"id":212661675,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjY2MTY3NQ==","diff_hunk":"@@ -311,13 +343,57 @@ impl<M: Metadata, S: Middleware<M>> RpcHandler<M, S> {\n \t\t\tMethod::Options => {\n \t\t\t\tRpcHandlerState::Writing(Response::empty())\n \t\t\t},\n+\t\t\t// Respond to health API request if there is one configured.\n+\t\t\tMethod::Get if self.health_api.as_ref().map(|x| &*x.0) == Some(request.uri().path()) => {\n+\t\t\t\tRpcHandlerState::ProcessHealth {\n+\t\t\t\t\tmetadata,\n+\t\t\t\t\tmethod: self.health_api.as_ref()\n+\t\t\t\t\t\t\t.map(|x| x.1.clone())\n+\t\t\t\t\t\t\t.expect(\"Health api is defined since the URI matched.\"),\n+\t\t\t\t}\n+\t\t\t},\n \t\t\t// Disallow other methods.\n \t\t\t_ => {\n \t\t\t\tRpcHandlerState::Writing(Response::method_not_allowed())\n \t\t\t},\n \t\t}\n \t}\n \n+\tfn process_health(\n+\t\t&self,\n+\t\tmethod: String,\n+\t\tmetadata: M,\n+\t) -> Result<RpcPollState<M, S::Future>, hyper::Error> {\n+\t\tuse self::core::types::{Call, MethodCall, Version, Params, Request, Id, Output, Success, Failure};\n+\n+\t\t// Parse request\n+\t\tlet call = Request::Single(Call::MethodCall(MethodCall {\n+\t\t\tjsonrpc: Some(Version::V2),\n+\t\t\tmethod,\n+\t\t\tparams: Params::None,\n+\t\t\tid: Id::Num(1),","path":"http/src/handler.rs","position":138,"original_position":138,"commit_id":"1ad9bb57e0feff0fb4061a927f1536b6edfa436a","original_commit_id":"6a77c0088dc565eb0a2b4e74e20c7b769876b977","user":{"login":"NikVolf","id":3186518,"node_id":"MDQ6VXNlcjMxODY1MTg=","avatar_url":"https://avatars0.githubusercontent.com/u/3186518?v=4","gravatar_id":"","url":"https://api.github.com/users/NikVolf","html_url":"https://github.com/NikVolf","followers_url":"https://api.github.com/users/NikVolf/followers","following_url":"https://api.github.com/users/NikVolf/following{/other_user}","gists_url":"https://api.github.com/users/NikVolf/gists{/gist_id}","starred_url":"https://api.github.com/users/NikVolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NikVolf/subscriptions","organizations_url":"https://api.github.com/users/NikVolf/orgs","repos_url":"https://api.github.com/users/NikVolf/repos","events_url":"https://api.github.com/users/NikVolf/events{/privacy}","received_events_url":"https://api.github.com/users/NikVolf/received_events","type":"User","site_admin":false},"body":"(one that he sent himself, one from health response)","created_at":"2018-08-24T15:13:49Z","updated_at":"2018-08-24T15:13:50Z","html_url":"https://github.com/paritytech/jsonrpc/pull/301#discussion_r212661675","pull_request_url":"https://api.github.com/repos/paritytech/jsonrpc/pulls/301","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/paritytech/jsonrpc/pulls/comments/212661675"},"html":{"href":"https://github.com/paritytech/jsonrpc/pull/301#discussion_r212661675"},"pull_request":{"href":"https://api.github.com/repos/paritytech/jsonrpc/pulls/301"}},"in_reply_to_id":212652076},"pull_request":{"url":"https://api.github.com/repos/paritytech/jsonrpc/pulls/301","id":210752838,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNzUyODM4","html_url":"https://github.com/paritytech/jsonrpc/pull/301","diff_url":"https://github.com/paritytech/jsonrpc/pull/301.diff","patch_url":"https://github.com/paritytech/jsonrpc/pull/301.patch","issue_url":"https://api.github.com/repos/paritytech/jsonrpc/issues/301","number":301,"state":"open","locked":false,"title":"Health API handling.","user":{"login":"tomusdrw","id":581548,"node_id":"MDQ6VXNlcjU4MTU0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/581548?v=4","gravatar_id":"","url":"https://api.github.com/users/tomusdrw","html_url":"https://github.com/tomusdrw","followers_url":"https://api.github.com/users/tomusdrw/followers","following_url":"https://api.github.com/users/tomusdrw/following{/other_user}","gists_url":"https://api.github.com/users/tomusdrw/gists{/gist_id}","starred_url":"https://api.github.com/users/tomusdrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomusdrw/subscriptions","organizations_url":"https://api.github.com/users/tomusdrw/orgs","repos_url":"https://api.github.com/users/tomusdrw/repos","events_url":"https://api.github.com/users/tomusdrw/events{/privacy}","received_events_url":"https://api.github.com/users/tomusdrw/received_events","type":"User","site_admin":false},"body":"Allows to expose health endpoint for HTTP server that delegates to one of the RPCs.","created_at":"2018-08-24T14:13:35Z","updated_at":"2018-08-24T15:13:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"450de0cbdc3df31b565de60db212090147691b15","assignee":null,"assignees":[],"requested_reviewers":[{"login":"debris","id":2613714,"node_id":"MDQ6VXNlcjI2MTM3MTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2613714?v=4","gravatar_id":"","url":"https://api.github.com/users/debris","html_url":"https://github.com/debris","followers_url":"https://api.github.com/users/debris/followers","following_url":"https://api.github.com/users/debris/following{/other_user}","gists_url":"https://api.github.com/users/debris/gists{/gist_id}","starred_url":"https://api.github.com/users/debris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debris/subscriptions","organizations_url":"https://api.github.com/users/debris/orgs","repos_url":"https://api.github.com/users/debris/repos","events_url":"https://api.github.com/users/debris/events{/privacy}","received_events_url":"https://api.github.com/users/debris/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/paritytech/jsonrpc/pulls/301/commits","review_comments_url":"https://api.github.com/repos/paritytech/jsonrpc/pulls/301/comments","review_comment_url":"https://api.github.com/repos/paritytech/jsonrpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paritytech/jsonrpc/issues/301/comments","statuses_url":"https://api.github.com/repos/paritytech/jsonrpc/statuses/1ad9bb57e0feff0fb4061a927f1536b6edfa436a","head":{"label":"paritytech:td-health","ref":"td-health","sha":"1ad9bb57e0feff0fb4061a927f1536b6edfa436a","user":{"login":"paritytech","id":14176906,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc2OTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"repo":{"id":74377848,"node_id":"MDEwOlJlcG9zaXRvcnk3NDM3Nzg0OA==","name":"jsonrpc","full_name":"paritytech/jsonrpc","owner":{"login":"paritytech","id":14176906,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc2OTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paritytech/jsonrpc","description":"Rust JSON-RPC implementation","fork":false,"url":"https://api.github.com/repos/paritytech/jsonrpc","forks_url":"https://api.github.com/repos/paritytech/jsonrpc/forks","keys_url":"https://api.github.com/repos/paritytech/jsonrpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paritytech/jsonrpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paritytech/jsonrpc/teams","hooks_url":"https://api.github.com/repos/paritytech/jsonrpc/hooks","issue_events_url":"https://api.github.com/repos/paritytech/jsonrpc/issues/events{/number}","events_url":"https://api.github.com/repos/paritytech/jsonrpc/events","assignees_url":"https://api.github.com/repos/paritytech/jsonrpc/assignees{/user}","branches_url":"https://api.github.com/repos/paritytech/jsonrpc/branches{/branch}","tags_url":"https://api.github.com/repos/paritytech/jsonrpc/tags","blobs_url":"https://api.github.com/repos/paritytech/jsonrpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paritytech/jsonrpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paritytech/jsonrpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/paritytech/jsonrpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paritytech/jsonrpc/statuses/{sha}","languages_url":"https://api.github.com/repos/paritytech/jsonrpc/languages","stargazers_url":"https://api.github.com/repos/paritytech/jsonrpc/stargazers","contributors_url":"https://api.github.com/repos/paritytech/jsonrpc/contributors","subscribers_url":"https://api.github.com/repos/paritytech/jsonrpc/subscribers","subscription_url":"https://api.github.com/repos/paritytech/jsonrpc/subscription","commits_url":"https://api.github.com/repos/paritytech/jsonrpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/paritytech/jsonrpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/paritytech/jsonrpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/paritytech/jsonrpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/paritytech/jsonrpc/contents/{+path}","compare_url":"https://api.github.com/repos/paritytech/jsonrpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paritytech/jsonrpc/merges","archive_url":"https://api.github.com/repos/paritytech/jsonrpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paritytech/jsonrpc/downloads","issues_url":"https://api.github.com/repos/paritytech/jsonrpc/issues{/number}","pulls_url":"https://api.github.com/repos/paritytech/jsonrpc/pulls{/number}","milestones_url":"https://api.github.com/repos/paritytech/jsonrpc/milestones{/number}","notifications_url":"https://api.github.com/repos/paritytech/jsonrpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paritytech/jsonrpc/labels{/name}","releases_url":"https://api.github.com/repos/paritytech/jsonrpc/releases{/id}","deployments_url":"https://api.github.com/repos/paritytech/jsonrpc/deployments","created_at":"2016-11-21T15:32:15Z","updated_at":"2018-08-22T11:50:14Z","pushed_at":"2018-08-24T15:05:04Z","git_url":"git://github.com/paritytech/jsonrpc.git","ssh_url":"git@github.com:paritytech/jsonrpc.git","clone_url":"https://github.com/paritytech/jsonrpc.git","svn_url":"https://github.com/paritytech/jsonrpc","homepage":"","size":2437,"stargazers_count":143,"watchers_count":143,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":45,"open_issues":42,"watchers":143,"default_branch":"master"}},"base":{"label":"paritytech:master","ref":"master","sha":"4486300ea5a02218a03524f8d4f3b214628afe7a","user":{"login":"paritytech","id":14176906,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc2OTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"repo":{"id":74377848,"node_id":"MDEwOlJlcG9zaXRvcnk3NDM3Nzg0OA==","name":"jsonrpc","full_name":"paritytech/jsonrpc","owner":{"login":"paritytech","id":14176906,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc2OTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paritytech/jsonrpc","description":"Rust JSON-RPC implementation","fork":false,"url":"https://api.github.com/repos/paritytech/jsonrpc","forks_url":"https://api.github.com/repos/paritytech/jsonrpc/forks","keys_url":"https://api.github.com/repos/paritytech/jsonrpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paritytech/jsonrpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paritytech/jsonrpc/teams","hooks_url":"https://api.github.com/repos/paritytech/jsonrpc/hooks","issue_events_url":"https://api.github.com/repos/paritytech/jsonrpc/issues/events{/number}","events_url":"https://api.github.com/repos/paritytech/jsonrpc/events","assignees_url":"https://api.github.com/repos/paritytech/jsonrpc/assignees{/user}","branches_url":"https://api.github.com/repos/paritytech/jsonrpc/branches{/branch}","tags_url":"https://api.github.com/repos/paritytech/jsonrpc/tags","blobs_url":"https://api.github.com/repos/paritytech/jsonrpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paritytech/jsonrpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paritytech/jsonrpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/paritytech/jsonrpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paritytech/jsonrpc/statuses/{sha}","languages_url":"https://api.github.com/repos/paritytech/jsonrpc/languages","stargazers_url":"https://api.github.com/repos/paritytech/jsonrpc/stargazers","contributors_url":"https://api.github.com/repos/paritytech/jsonrpc/contributors","subscribers_url":"https://api.github.com/repos/paritytech/jsonrpc/subscribers","subscription_url":"https://api.github.com/repos/paritytech/jsonrpc/subscription","commits_url":"https://api.github.com/repos/paritytech/jsonrpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/paritytech/jsonrpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/paritytech/jsonrpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/paritytech/jsonrpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/paritytech/jsonrpc/contents/{+path}","compare_url":"https://api.github.com/repos/paritytech/jsonrpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paritytech/jsonrpc/merges","archive_url":"https://api.github.com/repos/paritytech/jsonrpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paritytech/jsonrpc/downloads","issues_url":"https://api.github.com/repos/paritytech/jsonrpc/issues{/number}","pulls_url":"https://api.github.com/repos/paritytech/jsonrpc/pulls{/number}","milestones_url":"https://api.github.com/repos/paritytech/jsonrpc/milestones{/number}","notifications_url":"https://api.github.com/repos/paritytech/jsonrpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paritytech/jsonrpc/labels{/name}","releases_url":"https://api.github.com/repos/paritytech/jsonrpc/releases{/id}","deployments_url":"https://api.github.com/repos/paritytech/jsonrpc/deployments","created_at":"2016-11-21T15:32:15Z","updated_at":"2018-08-22T11:50:14Z","pushed_at":"2018-08-24T15:05:04Z","git_url":"git://github.com/paritytech/jsonrpc.git","ssh_url":"git@github.com:paritytech/jsonrpc.git","clone_url":"https://github.com/paritytech/jsonrpc.git","svn_url":"https://github.com/paritytech/jsonrpc","homepage":"","size":2437,"stargazers_count":143,"watchers_count":143,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":45,"open_issues":42,"watchers":143,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paritytech/jsonrpc/pulls/301"},"html":{"href":"https://github.com/paritytech/jsonrpc/pull/301"},"issue":{"href":"https://api.github.com/repos/paritytech/jsonrpc/issues/301"},"comments":{"href":"https://api.github.com/repos/paritytech/jsonrpc/issues/301/comments"},"review_comments":{"href":"https://api.github.com/repos/paritytech/jsonrpc/pulls/301/comments"},"review_comment":{"href":"https://api.github.com/repos/paritytech/jsonrpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paritytech/jsonrpc/pulls/301/commits"},"statuses":{"href":"https://api.github.com/repos/paritytech/jsonrpc/statuses/1ad9bb57e0feff0fb4061a927f1536b6edfa436a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"NikVolf"}}