{"action":"opened","number":11,"pull_request":{"url":"https://api.github.com/repos/heroku/cowboy/pulls/11","id":27361987,"html_url":"https://github.com/heroku/cowboy/pull/11","diff_url":"https://github.com/heroku/cowboy/pull/11.diff","patch_url":"https://github.com/heroku/cowboy/pull/11.patch","issue_url":"https://api.github.com/repos/heroku/cowboy/issues/11","number":11,"state":"open","locked":false,"title":"Workaround HEAD responses with undefined lengths","user":{"login":"ferd","id":111141,"avatar_url":"https://avatars.githubusercontent.com/u/111141?v=3","gravatar_id":"","url":"https://api.github.com/users/ferd","html_url":"https://github.com/ferd","followers_url":"https://api.github.com/users/ferd/followers","following_url":"https://api.github.com/users/ferd/following{/other_user}","gists_url":"https://api.github.com/users/ferd/gists{/gist_id}","starred_url":"https://api.github.com/users/ferd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferd/subscriptions","organizations_url":"https://api.github.com/users/ferd/orgs","repos_url":"https://api.github.com/users/ferd/repos","events_url":"https://api.github.com/users/ferd/events{/privacy}","received_events_url":"https://api.github.com/users/ferd/received_events","type":"User","site_admin":false},"body":"While Cowboy's strict and always requires to put a content-length in a\r\nresponse to a HEAD request, the clients Heroku proxies for do not always\r\nend up doing so, and leave the content-length value as missing.\r\n\r\nIn usual circumstances, this would mean that the connection is\r\nclose-delimited, and this is how we treat it (we can't know if it's an\r\n'unknown' value that needs to be streamed, or an omission, and both\r\nhappen in the wild).\r\n\r\nThe issue is that because HEAD responses are often used as an\r\noptimization, closing the connection on these (because we faithfully\r\nreplicate the expected 'connection:close' header) ends up being\r\ninefficient in many cases.\r\n\r\nBecause of this, we use a streaming function with an unknown length that\r\nshortcircuits the creation of content-length headers -- which the\r\nstreaming function is meant for -- The issue is that in some\r\ncircumstances (HEAD requests) we may want to override the 'close' value\r\non a case-by-case basis.\r\n\r\nThis patch lets us do this.","created_at":"2015-01-14T16:23:46Z","updated_at":"2015-01-14T16:23:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/heroku/cowboy/pulls/11/commits","review_comments_url":"https://api.github.com/repos/heroku/cowboy/pulls/11/comments","review_comment_url":"https://api.github.com/repos/heroku/cowboy/pulls/comments/{number}","comments_url":"https://api.github.com/repos/heroku/cowboy/issues/11/comments","statuses_url":"https://api.github.com/repos/heroku/cowboy/statuses/f3b2a8847c9def2bc8ac6fcaefb5cf171ab48bfa","head":{"label":"heroku:heroku_proxy_head_connection","ref":"heroku_proxy_head_connection","sha":"f3b2a8847c9def2bc8ac6fcaefb5cf171ab48bfa","user":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"repo":{"id":4553120,"name":"cowboy","full_name":"heroku/cowboy","owner":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heroku/cowboy","description":"Small, fast, modular HTTP server and socket acceptor pool.","fork":true,"url":"https://api.github.com/repos/heroku/cowboy","forks_url":"https://api.github.com/repos/heroku/cowboy/forks","keys_url":"https://api.github.com/repos/heroku/cowboy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/cowboy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/cowboy/teams","hooks_url":"https://api.github.com/repos/heroku/cowboy/hooks","issue_events_url":"https://api.github.com/repos/heroku/cowboy/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/cowboy/events","assignees_url":"https://api.github.com/repos/heroku/cowboy/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/cowboy/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/cowboy/tags","blobs_url":"https://api.github.com/repos/heroku/cowboy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/cowboy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/cowboy/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/cowboy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/cowboy/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/cowboy/languages","stargazers_url":"https://api.github.com/repos/heroku/cowboy/stargazers","contributors_url":"https://api.github.com/repos/heroku/cowboy/contributors","subscribers_url":"https://api.github.com/repos/heroku/cowboy/subscribers","subscription_url":"https://api.github.com/repos/heroku/cowboy/subscription","commits_url":"https://api.github.com/repos/heroku/cowboy/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/cowboy/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/cowboy/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/cowboy/issues/comments/{number}","contents_url":"https://api.github.com/repos/heroku/cowboy/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/cowboy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/cowboy/merges","archive_url":"https://api.github.com/repos/heroku/cowboy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/cowboy/downloads","issues_url":"https://api.github.com/repos/heroku/cowboy/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/cowboy/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/cowboy/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/cowboy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/cowboy/labels{/name}","releases_url":"https://api.github.com/repos/heroku/cowboy/releases{/id}","created_at":"2012-06-04T22:09:03Z","updated_at":"2015-01-08T08:01:03Z","pushed_at":"2015-01-14T16:23:13Z","git_url":"git://github.com/heroku/cowboy.git","ssh_url":"git@github.com:heroku/cowboy.git","clone_url":"https://github.com/heroku/cowboy.git","svn_url":"https://github.com/heroku/cowboy","homepage":"","size":5908,"stargazers_count":10,"watchers_count":10,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":10,"default_branch":"heroku_stable"}},"base":{"label":"heroku:heroku_proxy","ref":"heroku_proxy","sha":"c18819a72dca00df87d7dac9d08df4c75e4f50d2","user":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"repo":{"id":4553120,"name":"cowboy","full_name":"heroku/cowboy","owner":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heroku/cowboy","description":"Small, fast, modular HTTP server and socket acceptor pool.","fork":true,"url":"https://api.github.com/repos/heroku/cowboy","forks_url":"https://api.github.com/repos/heroku/cowboy/forks","keys_url":"https://api.github.com/repos/heroku/cowboy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/cowboy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/cowboy/teams","hooks_url":"https://api.github.com/repos/heroku/cowboy/hooks","issue_events_url":"https://api.github.com/repos/heroku/cowboy/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/cowboy/events","assignees_url":"https://api.github.com/repos/heroku/cowboy/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/cowboy/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/cowboy/tags","blobs_url":"https://api.github.com/repos/heroku/cowboy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/cowboy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/cowboy/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/cowboy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/cowboy/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/cowboy/languages","stargazers_url":"https://api.github.com/repos/heroku/cowboy/stargazers","contributors_url":"https://api.github.com/repos/heroku/cowboy/contributors","subscribers_url":"https://api.github.com/repos/heroku/cowboy/subscribers","subscription_url":"https://api.github.com/repos/heroku/cowboy/subscription","commits_url":"https://api.github.com/repos/heroku/cowboy/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/cowboy/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/cowboy/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/cowboy/issues/comments/{number}","contents_url":"https://api.github.com/repos/heroku/cowboy/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/cowboy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/cowboy/merges","archive_url":"https://api.github.com/repos/heroku/cowboy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/cowboy/downloads","issues_url":"https://api.github.com/repos/heroku/cowboy/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/cowboy/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/cowboy/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/cowboy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/cowboy/labels{/name}","releases_url":"https://api.github.com/repos/heroku/cowboy/releases{/id}","created_at":"2012-06-04T22:09:03Z","updated_at":"2015-01-08T08:01:03Z","pushed_at":"2015-01-14T16:23:13Z","git_url":"git://github.com/heroku/cowboy.git","ssh_url":"git@github.com:heroku/cowboy.git","clone_url":"https://github.com/heroku/cowboy.git","svn_url":"https://github.com/heroku/cowboy","homepage":"","size":5908,"stargazers_count":10,"watchers_count":10,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":10,"default_branch":"heroku_stable"}},"_links":{"self":{"href":"https://api.github.com/repos/heroku/cowboy/pulls/11"},"html":{"href":"https://github.com/heroku/cowboy/pull/11"},"issue":{"href":"https://api.github.com/repos/heroku/cowboy/issues/11"},"comments":{"href":"https://api.github.com/repos/heroku/cowboy/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/heroku/cowboy/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/heroku/cowboy/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/heroku/cowboy/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/heroku/cowboy/statuses/f3b2a8847c9def2bc8ac6fcaefb5cf171ab48bfa"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":10,"deletions":1,"changed_files":1}}