{"action":"created","comment":{"url":"https://api.github.com/repos/yarpc/yarpc-node/pulls/comments/57629954","id":57629954,"diff_hunk":"@@ -227,6 +232,121 @@ function run(callback) {\n     }\n }\n \n+behaviors.headers = function headers(params, results, callback) {\n+    var subject = makeSubject(params);\n+    var headerTest = headerTests[params.encoding];\n+    headerTest(subject, onResult);\n+\n+    function onResult(err, result) {\n+        if (err) {\n+            results.push({\n+                behavior: 'headers',\n+                transport: params.transport,\n+                encoding: params.encoding,\n+                server: params.server,\n+                status: 'failed',\n+                output: err && err.stack || err\n+            });\n+        } else {\n+            results.push({\n+                behavior: 'headers',\n+                transport: params.transport,\n+                encoding: params.encoding,\n+                server: params.server,\n+                status: result.status,\n+                output: result.output\n+            });\n+        }\n+        subject.stop(onStop);\n+    }\n+\n+    function onStop() {\n+        callback(null);\n+    }\n+};\n+behaviors.headers.axes = ['server', 'transport', 'encoding'];\n+\n+var headerTests = {\n+    raw: headerTestRaw,\n+    json: headerTestJson,\n+    thrift: headerTestThrift\n+};\n+\n+function headerTestRaw(subject, callback) {\n+    var token = Math.random().toString(36).slice(2, 7 + 2);\n+\n+    var headers = {};\n+    headers[token] = token;\n+\n+    subject.echoRaw({\n+        body: token,\n+        headers: headers\n+    }, onResponse);\n+\n+    function onResponse(err, response) {\n+        if (err) {\n+            callback(err);\n+            return;\n+        }\n+\n+        callback(null, new EqualsAssertion(\n+            response.headers[token],\n+            token,\n+            'Server echoed header: ' + token\n+        ));\n+    }\n+}\n+\n+function headerTestJson(subject, callback) {\n+    var token = Math.random().toString(36).slice(2, 7 + 2);\n+\n+    var headers = {};\n+    headers[token] = token;\n+\n+    subject.echoJson({\n+        body: {token: token},\n+        headers: headers\n+    }, onResponse);\n+\n+    function onResponse(err, response) {\n+        if (err) {\n+            callback(err);\n+            return;\n+        }\n+\n+        callback(null, new EqualsAssertion(\n+            response.headers[token],\n+            token,\n+            'Server echoed header: ' + token\n+        ));\n+    }\n+}\n+\n+function headerTestThrift(subject, callback) {","path":"test/behaviors.js","position":155,"original_position":155,"commit_id":"f28f1d6f2c7d5feb207267661b2463921bad9c87","original_commit_id":"f28f1d6f2c7d5feb207267661b2463921bad9c87","user":{"login":"breerly","id":263587,"avatar_url":"https://avatars.githubusercontent.com/u/263587?v=3","gravatar_id":"","url":"https://api.github.com/users/breerly","html_url":"https://github.com/breerly","followers_url":"https://api.github.com/users/breerly/followers","following_url":"https://api.github.com/users/breerly/following{/other_user}","gists_url":"https://api.github.com/users/breerly/gists{/gist_id}","starred_url":"https://api.github.com/users/breerly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breerly/subscriptions","organizations_url":"https://api.github.com/users/breerly/orgs","repos_url":"https://api.github.com/users/breerly/repos","events_url":"https://api.github.com/users/breerly/events{/privacy}","received_events_url":"https://api.github.com/users/breerly/received_events","type":"User","site_admin":false},"body":"these 3 tests look really similar - you think about parameterizing them somehow","created_at":"2016-03-28T20:41:25Z","updated_at":"2016-03-28T20:41:25Z","html_url":"https://github.com/yarpc/yarpc-node/pull/54#discussion_r57629954","pull_request_url":"https://api.github.com/repos/yarpc/yarpc-node/pulls/54","_links":{"self":{"href":"https://api.github.com/repos/yarpc/yarpc-node/pulls/comments/57629954"},"html":{"href":"https://github.com/yarpc/yarpc-node/pull/54#discussion_r57629954"},"pull_request":{"href":"https://api.github.com/repos/yarpc/yarpc-node/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/yarpc/yarpc-node/pulls/54","id":64347107,"html_url":"https://github.com/yarpc/yarpc-node/pull/54","diff_url":"https://github.com/yarpc/yarpc-node/pull/54.diff","patch_url":"https://github.com/yarpc/yarpc-node/pull/54.patch","issue_url":"https://api.github.com/repos/yarpc/yarpc-node/issues/54","number":54,"state":"open","locked":false,"title":"Test and fix headers support","user":{"login":"kriskowal","id":60294,"avatar_url":"https://avatars.githubusercontent.com/u/60294?v=3","gravatar_id":"","url":"https://api.github.com/users/kriskowal","html_url":"https://github.com/kriskowal","followers_url":"https://api.github.com/users/kriskowal/followers","following_url":"https://api.github.com/users/kriskowal/following{/other_user}","gists_url":"https://api.github.com/users/kriskowal/gists{/gist_id}","starred_url":"https://api.github.com/users/kriskowal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kriskowal/subscriptions","organizations_url":"https://api.github.com/users/kriskowal/orgs","repos_url":"https://api.github.com/users/kriskowal/repos","events_url":"https://api.github.com/users/kriskowal/events{/privacy}","received_events_url":"https://api.github.com/users/kriskowal/received_events","type":"User","site_admin":false},"body":"This adds support for request headers and exercises the tests in the unit test suite. The tests are also available to crossdock, but not this branch does not include the crossdock integration.\r\n\r\nr @yarpc/yarpc @yarpc/node","created_at":"2016-03-28T17:29:30Z","updated_at":"2016-03-28T20:41:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2763f13b472690202f29d607762d2783d51854a4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yarpc/yarpc-node/pulls/54/commits","review_comments_url":"https://api.github.com/repos/yarpc/yarpc-node/pulls/54/comments","review_comment_url":"https://api.github.com/repos/yarpc/yarpc-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yarpc/yarpc-node/issues/54/comments","statuses_url":"https://api.github.com/repos/yarpc/yarpc-node/statuses/f28f1d6f2c7d5feb207267661b2463921bad9c87","head":{"label":"yarpc:headers","ref":"headers","sha":"f28f1d6f2c7d5feb207267661b2463921bad9c87","user":{"login":"yarpc","id":16569504,"avatar_url":"https://avatars.githubusercontent.com/u/16569504?v=3","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"repo":{"id":50390070,"name":"yarpc-node","full_name":"yarpc/yarpc-node","owner":{"login":"yarpc","id":16569504,"avatar_url":"https://avatars.githubusercontent.com/u/16569504?v=3","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yarpc/yarpc-node","description":"YARPC for Node.js","fork":false,"url":"https://api.github.com/repos/yarpc/yarpc-node","forks_url":"https://api.github.com/repos/yarpc/yarpc-node/forks","keys_url":"https://api.github.com/repos/yarpc/yarpc-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarpc/yarpc-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarpc/yarpc-node/teams","hooks_url":"https://api.github.com/repos/yarpc/yarpc-node/hooks","issue_events_url":"https://api.github.com/repos/yarpc/yarpc-node/issues/events{/number}","events_url":"https://api.github.com/repos/yarpc/yarpc-node/events","assignees_url":"https://api.github.com/repos/yarpc/yarpc-node/assignees{/user}","branches_url":"https://api.github.com/repos/yarpc/yarpc-node/branches{/branch}","tags_url":"https://api.github.com/repos/yarpc/yarpc-node/tags","blobs_url":"https://api.github.com/repos/yarpc/yarpc-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarpc/yarpc-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarpc/yarpc-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarpc/yarpc-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarpc/yarpc-node/statuses/{sha}","languages_url":"https://api.github.com/repos/yarpc/yarpc-node/languages","stargazers_url":"https://api.github.com/repos/yarpc/yarpc-node/stargazers","contributors_url":"https://api.github.com/repos/yarpc/yarpc-node/contributors","subscribers_url":"https://api.github.com/repos/yarpc/yarpc-node/subscribers","subscription_url":"https://api.github.com/repos/yarpc/yarpc-node/subscription","commits_url":"https://api.github.com/repos/yarpc/yarpc-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarpc/yarpc-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarpc/yarpc-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarpc/yarpc-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarpc/yarpc-node/contents/{+path}","compare_url":"https://api.github.com/repos/yarpc/yarpc-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarpc/yarpc-node/merges","archive_url":"https://api.github.com/repos/yarpc/yarpc-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarpc/yarpc-node/downloads","issues_url":"https://api.github.com/repos/yarpc/yarpc-node/issues{/number}","pulls_url":"https://api.github.com/repos/yarpc/yarpc-node/pulls{/number}","milestones_url":"https://api.github.com/repos/yarpc/yarpc-node/milestones{/number}","notifications_url":"https://api.github.com/repos/yarpc/yarpc-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarpc/yarpc-node/labels{/name}","releases_url":"https://api.github.com/repos/yarpc/yarpc-node/releases{/id}","deployments_url":"https://api.github.com/repos/yarpc/yarpc-node/deployments","created_at":"2016-01-26T00:02:57Z","updated_at":"2016-03-17T19:55:16Z","pushed_at":"2016-03-28T20:35:37Z","git_url":"git://github.com/yarpc/yarpc-node.git","ssh_url":"git@github.com:yarpc/yarpc-node.git","clone_url":"https://github.com/yarpc/yarpc-node.git","svn_url":"https://github.com/yarpc/yarpc-node","homepage":"","size":139,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":1,"default_branch":"master"}},"base":{"label":"yarpc:master","ref":"master","sha":"d78c12a664671da7e90eb41f79f1136091702d37","user":{"login":"yarpc","id":16569504,"avatar_url":"https://avatars.githubusercontent.com/u/16569504?v=3","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"repo":{"id":50390070,"name":"yarpc-node","full_name":"yarpc/yarpc-node","owner":{"login":"yarpc","id":16569504,"avatar_url":"https://avatars.githubusercontent.com/u/16569504?v=3","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yarpc/yarpc-node","description":"YARPC for Node.js","fork":false,"url":"https://api.github.com/repos/yarpc/yarpc-node","forks_url":"https://api.github.com/repos/yarpc/yarpc-node/forks","keys_url":"https://api.github.com/repos/yarpc/yarpc-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarpc/yarpc-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarpc/yarpc-node/teams","hooks_url":"https://api.github.com/repos/yarpc/yarpc-node/hooks","issue_events_url":"https://api.github.com/repos/yarpc/yarpc-node/issues/events{/number}","events_url":"https://api.github.com/repos/yarpc/yarpc-node/events","assignees_url":"https://api.github.com/repos/yarpc/yarpc-node/assignees{/user}","branches_url":"https://api.github.com/repos/yarpc/yarpc-node/branches{/branch}","tags_url":"https://api.github.com/repos/yarpc/yarpc-node/tags","blobs_url":"https://api.github.com/repos/yarpc/yarpc-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarpc/yarpc-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarpc/yarpc-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarpc/yarpc-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarpc/yarpc-node/statuses/{sha}","languages_url":"https://api.github.com/repos/yarpc/yarpc-node/languages","stargazers_url":"https://api.github.com/repos/yarpc/yarpc-node/stargazers","contributors_url":"https://api.github.com/repos/yarpc/yarpc-node/contributors","subscribers_url":"https://api.github.com/repos/yarpc/yarpc-node/subscribers","subscription_url":"https://api.github.com/repos/yarpc/yarpc-node/subscription","commits_url":"https://api.github.com/repos/yarpc/yarpc-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarpc/yarpc-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarpc/yarpc-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarpc/yarpc-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarpc/yarpc-node/contents/{+path}","compare_url":"https://api.github.com/repos/yarpc/yarpc-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarpc/yarpc-node/merges","archive_url":"https://api.github.com/repos/yarpc/yarpc-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarpc/yarpc-node/downloads","issues_url":"https://api.github.com/repos/yarpc/yarpc-node/issues{/number}","pulls_url":"https://api.github.com/repos/yarpc/yarpc-node/pulls{/number}","milestones_url":"https://api.github.com/repos/yarpc/yarpc-node/milestones{/number}","notifications_url":"https://api.github.com/repos/yarpc/yarpc-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarpc/yarpc-node/labels{/name}","releases_url":"https://api.github.com/repos/yarpc/yarpc-node/releases{/id}","deployments_url":"https://api.github.com/repos/yarpc/yarpc-node/deployments","created_at":"2016-01-26T00:02:57Z","updated_at":"2016-03-17T19:55:16Z","pushed_at":"2016-03-28T20:35:37Z","git_url":"git://github.com/yarpc/yarpc-node.git","ssh_url":"git@github.com:yarpc/yarpc-node.git","clone_url":"https://github.com/yarpc/yarpc-node.git","svn_url":"https://github.com/yarpc/yarpc-node","homepage":"","size":139,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yarpc/yarpc-node/pulls/54"},"html":{"href":"https://github.com/yarpc/yarpc-node/pull/54"},"issue":{"href":"https://api.github.com/repos/yarpc/yarpc-node/issues/54"},"comments":{"href":"https://api.github.com/repos/yarpc/yarpc-node/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/yarpc/yarpc-node/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/yarpc/yarpc-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yarpc/yarpc-node/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/yarpc/yarpc-node/statuses/f28f1d6f2c7d5feb207267661b2463921bad9c87"}}}}